Skip to contents

Row bind elements 1:1 to a data frame

Usage

rbindToDataFrame(x, ...)

# S4 method for list
rbindToDataFrame(x)

Arguments

x

Object.

...

Additional arguments.

Value

DataFrame.

Note

Updated 2023-02-22.

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