list.cbind: Bind all list elements by column

Description Usage Arguments See Also Examples

View source: R/list.do.R

Description

The function binds all list elements by column. Each element of the list is expected to be an atomic vector, data.frame, or data.table of the same length. If list elements are also lists, the binding will flatten the lists and may produce undesired results.

Usage

1
list.cbind(.data)

Arguments

.data

list

See Also

list.cbind, list.stack

Examples

1
2
3
x <- list(data.frame(i=1:5,x=rnorm(5)),
   data.frame(y=rnorm(5),z=rnorm(5)))
list.cbind(x)

Example output

  i          x          y          z
1 1 -1.5194943 -2.5033196  0.2795793
2 2 -2.6251711  1.0319427 -0.7427051
3 3 -0.5817269  0.5607442 -0.7145347
4 4 -0.3782417 -1.4242857  0.7323007
5 5  0.5616764 -0.1356703  0.8103360

rlist documentation built on Sept. 5, 2021, 5:30 p.m.