[R] ff object in lapply function

Uwe Ligges ligges at statistik.tu-dortmund.de
Thu Dec 22 09:52:57 CET 2011



On 22.12.2011 07:56, khai wrote:
> Hello. I'm using as.ffdf(mydataframe) to create ffdf objects inside an lapply
> loop and returning that. I then use crbind to combine the lapply results
> into allData.
>
> So...simplified flow looks like this.
>
> res<- lapply(1:nchunks, function(n)
>            {
>                  blah blah with nth chunk
>                  mydataframe<- data.frame(blah blah)
>                 dat<- as.ffdf(mydataframe)
>                 return(dat)
>            })
>
> allDat<- do.call('crbind',res)
>
>> allDat
>       virtual physical row.names
> [1,] List,7  List,4   NULL
> [2,] List,7  List,4   NULL
> [3,] List,7  List,4   NULL
> [4,] List,7  List,4   NULL
> [5,] List,7  List,4   NULL
> [6,] List,7  List,4   NULL
> [7,] List,7  List,4   NULL
> [8,] List,7  List,4   NULL
>
>> is.ffdf(allDat)
> [1] FALSE
>
>> is.ffdf(allDat[1,])
> [1] FALSE
>
> I can access the physical data.  After accessing allDat with calls like
> below within another function
>
> ffDat<- allDat[1,]
> nEvents<- length(ffDat$physical$position)
> pos<- ffDat$physical$position[1:nEvents]
>
> several times to retrieve information, I encounter segmentation faults which
> forces me to abort out of R. I'm wondering what I should be doing to prevent
> the segmentation faults.

Try to find a simple and for others reproducible example that reproduces 
the error / segfault. If it is related to a package like ff, report to 
its maintainer, if it is related to R, report to R-devel and if you are 
really (!) sure it is in R rather than in a contributed package, report 
to the bugtraking system.

Uwe Ligges



>
> Thanks for any advice!
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/ff-object-in-lapply-function-tp4224441p4224441.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list