我尝试使用RSQLite包中的dbWriteTable将带有285,476行和17列的data.frame写入SQlite数据库。我收到以下错误:
Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
然后我增加了限制
options(expressions = 500000)
并再次尝试,只是收到类似的错误:
Error: protect(): protection stack overflow
写入文本文件没有问题,并创建一个约50MB的文件。
任何线索是怎么回事?
答案 0 :(得分:1)
在准备错误报告时,我发现上述问题是由于在R 3.3.0中加载'rworldmap'软件包(1.3-6)和'RSQlite'软件包(1.0.0)引起的(运行时)在:Windows 7 x64(内部版本7601)Service Pack 1; x86_64-w64-mingw32 / x64(64位))。只要未加载“rworldmap”或以前的R版本(3.1.1; rworldmap 1.3-6; RSQLite 0.11.4),SQLite上传就会起作用。
见下文:
$("#orange-ball").mouseout(circulate(...
R版本3.3.0的$("#orange-ball").mouseover(function(){
$(this).circulate
require(RSQLite) # load package
require(rworldmap)
# created dataframe
my.df <- data.frame(col1 = 1:500000,
col2 = as.character("blah"),
col3 = as.character("blahblahblah"),
col4 = as.character("2016-08-10 12:47:07"),
col5 = as.character("2016-08-10 12:47:07"),
col6 = as.character("2016-08-10 12:47:07"),
col7 = as.character("2016-08-10 12:47:07"),
col8 = as.character("2016-08-10 12:47:07"),
col9 = as.character("2016-08-10 12:47:07"),
col10 = as.character("2016-08-10 12:47:07"),
col11 = as.character("2016-08-10 12:47:07"),
col12 = 1,col13 = 1,col14 = 1,col15 = 1,col16 = 1,col17 = 1,col18 = 1
)
# connect and upload to SQLite database
db=paste("test.sqlite",sep="")
conLite = dbConnect(dbDriver("SQLite"),dbname = db)
dbGetQuery(conLite,paste( "DROP TABLE IF EXISTS test"))
dbWriteTable(conn=conLite, name = 'test', value = my.df, row.names = FALSE)
# R 3.3.0 gives: Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
dbDisconnect(conLite)