View source: R/translate_wide.R
wide_to_condensed | R Documentation |
Convert from wide format to condensed format based on the prefix for each set of linked values across multiple columns.
wide_to_condensed( data, column_stem, value_sep = ";", name_sep = "_", readable = TRUE )
data |
A dataframe containing rows of systematic review data in wide format. |
column_stem |
A set of column descriptors signifying the groups of columns to condense based on a common stem (e.g. 'hazard' represents 'hazard_low', 'hazard_moderate', and 'hazard_high'). |
value_sep |
A character used to separate values within the data. The default is set to ';'. |
name_sep |
A character used to separate terms in the newly generated column names within the data. The default is set to '_' (i.e. snake_case). |
readable |
Logical argument (TRUE or FALSE) specifying whether the value separator should be followed by a space to improve readability (e.g. '; ' instead of ';'). The default is set to 'readable = TRUE'. |
A dataframe in 'condensed' format.
## Not run: column_stem <- 'hazard' condensed <- wide_to_condensed(data, column_stem, readable = TRUE) condensed; ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.