1

I want to replace all values within an ffdf (using ff package in R for large data). Typically, in a normal dataframe, I would use something like this:

df[df>0] <- 1

Is there an analogous method for ffdf? I wish to keep the object as class "ffdf".

niafall
  • 164
  • 1
  • 1
  • 11
  • It looks like `df[which(df[, 1:ncol(df)] > 0, arr.ind = TRUE)] <- 1` works, but I have no experience with this and perhaps it's not the nicest way. Also perhaps it's not very efficient as `df[, 1:ncol(df)]` seems to be converting `df` to a `data.frame`. – Julius Vainora Nov 01 '18 at 15:11
  • Yes, so far this has been my problem. I cannot execute the command without converting to a dataframe. I should add this to the original question. – niafall Nov 01 '18 at 15:13

0 Answers0