Re: [R] unfold list (variable number of columns) into a data frame

2011-10-23 Thread Giovanni Azua
Hi Dennis, Thank you very nice :) Best regards, Giovanni On Oct 23, 2011, at 6:55 PM, Dennis Murphy wrote: > Hi: > > Here's one approach: > > # Function to process a list component into a data frame > ff <- function(x) { > data.frame(time = x[1], partitioning_mode = x[2], workload = x[3],

Re: [R] unfold list (variable number of columns) into a data frame

2011-10-23 Thread Dennis Murphy
Hi: Here's one approach: # Function to process a list component into a data frame ff <- function(x) { data.frame(time = x[1], partitioning_mode = x[2], workload = x[3], runtime = as.numeric(x[4:length(x)]) ) } # Apply it to each element of the list: do.call(rbind, lapply(

[R] unfold list (variable number of columns) into a data frame

2011-10-23 Thread Giovanni Azua
Hello, I used R a lot one year ago and now I am a bit rusty :) I have my raw data which correspond to the list of runtimes per minute (minute "1" "2" "3" in two database modes "sharding" and "query" and two workload types "query" and "refresh") and as a list of char arrays that looks like this: