我想将 data.frame 转换为 ff 对象,as.ffdf 如此处所述
df.apr=as.data.frame(df.apr) # from data.table to data.frame
cols=df.apr[1,]
cols=sapply(cols,class)
df_apr=as.ffdf(df.apr,vmode=cols)
给出一个错误:
Error in ff(initdata = initdata, length = length, levels = levels, ordered = ordered,
: vmode 'numeric' not implemented
如果没有 'vmode' 参数,则会给出以下错误:
Error in ff(initdata = initdata, length = length, levels = levels, ordered = ordered,
: vmode 'character' not implemented
写到一张桌子上然后直接读入 ff 作品但是:
write.table(df.apr,file='df_apr.txt',sep='\t',row.names=F)
df.apr.ff=read.table.ffdf(file='df_apr.txt',header=F,VERBOSE=T)
但这很耗时[而且很笨拙]。有没有更好的办法?