
Last chance! 50% off unlimited learning
Sale ends in
Stack all list elements to tabular data
list.stack(.data, ..., data.table = FALSE)
list
of vector
s, list
s,
data.frame
s or data.table
s.
additional parameters passed to data.table::rbindlist
.
TRUE
to keep the result as data.table
# NOT RUN {
x <- lapply(1:3, function(i) { list(a=i,b=i^2) })
list.stack(x)
x <- lapply(1:3, function(i) { list(a=i,b=i^2,c=letters[i])})
list.stack(x)
x <- lapply(1:3, function(i) { data.frame(a=i,b=i^2,c=letters[i]) })
list.stack(x)
x <- lapply(1:3, function(i) { data.frame(a=c(i,i+1), b=c(i^2,i^2+1))})
list.stack(x)
# }
Run the code above in your browser using DataLab