[R-sig-hpc] Best way to implement ff

Jens Oehlschlägel jens.oehlschlaegel at truecluster.com
Fri Oct 1 22:57:39 CEST 2010


>I need to append columns to the data.>What is the best way of doing this? In "normal R" i would use cbind,>or similar. I looked around, but couldn't find anything. Something>like
Assuming you have for each virtual column a physical column you could do

simplecbind.ffdf <- function(d, x){
	nam <- colnames(d)
	ret <- do.call("ffdf", c(physical(d), list(x)))
	colnames(ret) <- c(nam, substitute(x))
	ret
}

library(ff)
x <- ff(1:10)
y <- ff(1:10)
d <- ffdf(x, y)
z <- ff(1:10)
dz <- simplecbind.ffdf(d, z)

Jens



More information about the R-sig-hpc mailing list