如何从 ffdf 对象中删除列? (右)

How to DROP columns from ffdf object ? (R)

我可以轻松删除 ffdf 对象的列吗?

library(ff);library(ffbase)    
irisdf=as.ffdf(iris)

如何只包含 Sepal.lengthSpecies 列?

您可以尝试 subset 来自 ffbase

library(ffbase)
Subiris <- subset(irisdf, select=c('Sepal.Length', 'Species'))
dim(Subiris)
#[1] 150   2
colnames(Subiris)
#[1] "Sepal.Length" "Species"     
library(ff)  
irisdf <- as.ffdf(iris)
filename(irisdf)
## Referencing the same data on disk (just making an new virtual ffdf)
example1 <- irisdf[setdiff(colnames(irisdf), c("Sepal.Length", "Species"))]
filename(example1)
## Referencing new data (copying)
example2 <- clone(irisdf[setdiff(colnames(irisdf), c("Sepal.Length", "Species"))])
filename(example2)