“long vectors not supported yet” error in Rmd but not in R Script

戏子无情 提交于 2019-12-03 14:21:12

问题


I am operating matrices with R 3.1 and RStudio 0.99.

I have my R Script and with cmd+enter it works without problem.

I created an Rmd for reporting but I have this error

Error in lazyLoadDBinsertVariable(vars[i], from, datafile, ascii, compress,  : 
  long vectors not supported yet: ../../../../R-3.3.1/src/main/connections.c:5600
Calls: <Anonymous> ... <Anonymous> -> <Anonymous> -> lazyLoadDBinsertVariable
Execution halted

Is there a way to bypass that error?

This seems to be a dupicate of Large Matrices in R: long vectors not supported yet

but the difference is that this only happens when trying to create an Rmd, not in any other case


回答1:


I also ran into this today, and fixed it by using cache.lazy = FALSE in the setup chunk in my .Rmd.

So what is inside of the first chunk in my R Markdown file looks like this:

library(knitr)
knitr::opts_chunk$set(cache = TRUE, warning = FALSE, 
                      message = FALSE, cache.lazy = FALSE)



回答2:


I am getting the same error in my .rmd file while trying to knit it to pdf. The incriminated code chunk was cached.

Is there a way to bypass that error?

Removing the 'cache = TRUE' or setting it to FALSE seems to fix the issue.



来源:https://stackoverflow.com/questions/39417003/long-vectors-not-supported-yet-error-in-rmd-but-not-in-r-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!