This is a convenience function serving as an
intermediate step in preparing the data for visualization.
The function builds a named list of the data elements.
The names will be used to group the data in subsequent
visualizations, so please ensure they are meaningful.
Each element will be coerced to a tibble
and row names are dropped, SORRY.
enlist_data(..., names = NULL)
Comma-separated input of tabular-type data. Any class
that inherits from data.frame
is permitted. Group names
are taken from these objects, unless names
is specified
Optional character vector of names corresponding to each data
data element in ...
A named list of tibble
s
x <- data.frame(a = 1:3, b = letters[1:3])
y <- data.frame(a = 4:6, b = letters[4:6])
# groups will be named "x" and "y"
enlist_data(x, y)
#> $x
#> # A tibble: 3 × 2
#> a b
#> <int> <chr>
#> 1 1 a
#> 2 2 b
#> 3 3 c
#>
#> $y
#> # A tibble: 3 × 2
#> a b
#> <int> <chr>
#> 1 4 d
#> 2 5 e
#> 3 6 f
#>
# groups will be named "old" and "new"
enlist_data(x, y, names = c("old", "new"))
#> $old
#> # A tibble: 3 × 2
#> a b
#> <int> <chr>
#> 1 1 a
#> 2 2 b
#> 3 3 c
#>
#> $new
#> # A tibble: 3 × 2
#> a b
#> <int> <chr>
#> 1 4 d
#> 2 5 e
#> 3 6 f
#>