我试图在我的ffdf中添加一个Source列,但似乎无法让它工作.如果这是一个正常的df,我会简单地写
mtcars$NewCol <- "AB" 如果我为ffdf执行此操作,它将返回一个错误。
require(ff)
require(ffbase)
mtcarsff <- as.ffdf(mtcars)
mtcars$NewCol <- "testname"
Error in `[[<-.ffdf`(`*tmp*`, i, value = "testname") :
assigned value must be ff有什么想法吗?
发布于 2015-07-20 21:58:14
这应该是可行的:
mtcarsff$NewCol <- as.ff(
rep(factor("AB"), times = nrow(mtcarsff))
)注意,"AB“必须被认为是一个因素,而不是一个字符。
https://stackoverflow.com/questions/31526550
复制相似问题