Description Usage Arguments Value Note Examples
Simple function to gather (reshape) data.
1 2 3 4 5 6 7 | minigather(
x,
gather_cols,
category_col_name,
value_col_name,
new_categories = NULL
)
|
x |
Data frame to reshape |
gather_cols |
Names of columns to gather, character vector |
category_col_name |
Name of resulting category column, character |
value_col_name |
Name of resulting value column, character |
new_categories |
Optional new categories to use in place of gathered column names, character vector |
The data frame in long format.
Base R's reshape
sucks, while gather
brings in tidyr
, which in turn imports dplyr
, ...way too heavy.
1 | cosore:::minigather(cars, c("speed", "dist"), "var", "val")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.