Row bind elements 1:1 to a data frame
Source:R/AllGenerics.R
, R/rbindToDataFrame-methods.R
rbindToDataFrame.Rd
Row bind elements 1:1 to a data frame
Examples
x <- list(
"a" = list(
"aa" = seq(from = 1L, to = 3L),
"bb" = seq(from = 4L, to = 6L)
),
"b" = list(
"cc" = seq(from = 7L, to = 9L),
"dd" = seq(from = 10L, to = 12L)
),
"c" = list(
"ee" = seq(from = 13L, to = 15L),
"ff" = seq(from = 16L, to = 18L)
)
)
print(x)
#> $a
#> $a$aa
#> [1] 1 2 3
#>
#> $a$bb
#> [1] 4 5 6
#>
#>
#> $b
#> $b$cc
#> [1] 7 8 9
#>
#> $b$dd
#> [1] 10 11 12
#>
#>
#> $c
#> $c$ee
#> [1] 13 14 15
#>
#> $c$ff
#> [1] 16 17 18
#>
#>
y <- rbindToDataFrame(x)
print(y)
#> DataFrame with 3 rows and 6 columns
#> aa bb cc dd ee ff
#> <list> <list> <list> <list> <list> <list>
#> a 1,2,3 4,5,6
#> b 7,8,9 10,11,12
#> c 13,14,15 16,17,18