Description Usage Arguments Value Examples
View source: R/pivot_module_tree.R
Create a table with one row per pivot variable
Create a table with one row per pivot variable
1 2 3 | get_pivot_vars(df, max_levels = 1000)
get_pivot_vars(df, max_levels = 1000)
|
df |
A local dataframe or tbl_dbi database table |
max_levels |
The maximum number of levels a pivot variable is allowed to have. |
df |
A local dataframe or tbl_dbi database table |
max_levels |
The maximum number of levels a pivot variable is allowed to have. |
A tibble with one row per pivot variable with the variable's name, number of levels, and a list column containing the levels.
A tibble with one row per pivot variable with the variable's name, number of levels, and a list column containing the levels.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # local table
df1 <- starwars %>%
select_if(is.character)
pivot_vars1 <- get_pivot_vars(df1)
# using a database
con <- DBI::dbConnect(RSQLite::SQLite(), path = ":memory:")
copy_to(con, df1, "star_wars")
df2 <- tbl(con, "star_wars")
pivot_vars2 <- get_pivot_vars(df2)
# local table
df1 <- starwars %>%
select_if(is.character)
pivot_vars1 <- get_pivot_vars(df1)
# using a database
con <- DBI::dbConnect(RSQLite::SQLite(), path = ":memory:")
copy_to(con, df1, "star_wars")
df2 <- tbl(con, "star_wars")
pivot_vars2 <- get_pivot_vars(df2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.