a <- data.frame(x=c(1,2,3), y=c(10,10,20))
a
x y
1 1 10
2 2 10
3 3 20
a$z = a$x / a$y # works with data frame
a
x y z
1 1 10 0.10
2 2 10 0.20
3 3 20 0.15
a <- data.frame(x=c(1,2,3), y=c(10,10,20))
a_ff <- as.ffdf(a)
a_ff$z = a_ff$x / a_ff$y # throws an error for a ff data frame
Error in a_ff$x/a_ff$y : non-numeric argument to binary operator
How do I update a ff data frame to add a column?
I have checked both ff and ffbase packages documentation but cannot find an example on how to do that.
I managed to get the operations done with: z <- ffdfwith(a_ff, x/y)
but then I do not know how to update the ff data frame with the new vector.