Q:

R{ff}- use apply in ffdf

I'm interested on using apply on a ffdf. I think I can't use ffdfdply because I'm not interested on splitting columns, because I have to use all components of the row, formed by 4 components("identifier1" "identifier2" "value" and "condition"), to fill 2 matrix depending on a condition. 
As this prior thread proposes (How to use apply or sapply or lapply with ffdf?) I've tried this:
apply(physical(myffdf),1,function(x){

  if( x["condition"]=="A"){
        matrix1[x["indentifier1"],x["identifier2"]] <<- x["value"]
  } ifelse( x["condition"]=="B") {
        matrix1[x["indentifier1"],x["identifier2"]] <<- x["value"]

  }
})

but I've read that physical() returns a list with atomic ff objects, so logically I can't use apply. 
Any suggestion?

A:

It seems, you want to apply a function over the rows. You can use chunk for that. Get you chunk in RAM and use apply and store it where you want (in RAM or in ff).
require(ff)
ffiris <- as.ffdf(iris)
for(i in chunk(ffiris)){
  x <- ffiris[i, ]
  apply(x, MARGIN=1, FUN=yourfunction)
}

