Description Usage Arguments Value Examples
View source: R/padis_general_functions.R
Gather one variable set from wide to long
1 2 | gather_one(data, key_vars, varying, keep_others = FALSE, new_name = NULL,
show_origin = FALSE)
|
data |
The data frame that contains the variables |
key_vars |
The key-variables or id variables that should be the grouping variables in the long format |
varying |
The variables that vary and should be stacked in the long format |
keep_others |
If |
new_name |
The new name of the stacked variable in the long format |
show_origin |
Logical, if |
Returns a data frame in long format
1 | gather_one(data=wide_example_data, key_vars = "id", varying = c("var_p_1", "var_p_2"), new_name = "var")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.