我正在使用在某些列中具有 NA 的 ffdf 对象。NA 是使用merge.ffdf进行左外部合并的结果。我想用 0 替换 NA,但无法做到。这是我正在运行的代码:
library(ffbase)
deals <- merge(deals,rk,by.x=c("DEALID","STICHTAG"),by.y=c("ID","STICHTAG"),all.x=TRUE)
attributes(deals)
$names
[1] "virtual" "physical" "row.names"
$class
[1] "ffdf"
vmode(deals$CREDIT_R)
[1] "double"
idx <- ffwhich(deals,is.na(CREDIT_R)) # CREDIT_R is one of the columns with NAs
deals.strom[idx,"CREDIT_R"]<-0
error in `[<-.ffdf`(`*tmp*`, idx, "CREDIT_R", value = 0) :
ff/ffdf-iness of value and selected columns don't match
知道我做错了什么吗?一般来说,我想了解更多关于替换 ff 和 ffdf 类的方法。有什么建议可以让我找到有关该主题的一些示例吗?