I have very large data sets given in a format similar to d below. Converting
these to a data frame is a bottleneck in my application. My fastest version
is given below, but it look clumsy to me.

Any ideas?

Dieter

# -----------------------
len = 100000
d = replicate(len, list(pH = 3,marker = TRUE,position = "A"),FALSE)
# Data are given as d

# preallocate vectors
pH =rep(0,len)
marker =rep(0,len)
position =rep(0,len)

system.time(
{
            for (i in 1:len)
            {
              d1 = d[[i]]
              #Assign to vectors
              pH[i] = d1[[1]]
              marker[i] = d1[[2]]
              position[i] = d1[[3]]
            }
        # combine vectors
        pHAll = data.frame(pH,marker,position)
}
)


-- 
View this message in context: 
http://n4.nabble.com/Fast-nested-List-data-frame-tp998871p998871.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@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.

Reply via email to