Search code examples
rmatrixbigdataapplyff

Using apply function with ff package in R


I am trying to apply a given function to the columns in a "as.ffdf" object but I haven't had any luck. Can anyone provide suggestions to the below? n = 3711 and myProbDensity has dimensions of 95248 rows and 3711 columns.

myDF <- as.ffdf(myProbDensity)
test <- ff(vmode = "double", dim = c(1, n))
test <- apply(myDF, MARGIN = 2, FUN = function(x)
                                   myQuantileFun(x = as, ex = myDF,
                                                 h = 0.001)

When executing the above code I get "you can only change the fastest rotating dim". I'm not really sure what this means. Also the myQuantileFun function returns a function and not a value (I'm not sure if this makes a difference). Any help would be great.


Solution

  • Instead of apply(myDF,...) try apply(myDF[,],...)