我可以轻松删除ffdf
对象的列吗?
library(ff);library(ffbase)
irisdf=as.ffdf(iris)
如何仅包含Sepal.length
和Species
列?
答案 0 :(得分:2)
您可以尝试subset
ffbase
library(ffbase)
Subiris <- subset(irisdf, select=c('Sepal.Length', 'Species'))
dim(Subiris)
#[1] 150 2
colnames(Subiris)
#[1] "Sepal.Length" "Species"
答案 1 :(得分:2)
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)