Convert from long format to long format based on the prefix for each set of linked values across multiple columns. Two-step process goes from long to wide and then from wide to condensed.

long_to_condensed(
  data,
  columns,
  value_sep = ";",
  name_sep = "_",
  readable = TRUE
)

Arguments

data

A dataframe containing rows of systematic review data in long format.

columns

A set of columns containing coded data from within a dataframe.

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'.

Value

A dataframe in 'condensed' format.

Examples

if (FALSE) { condensed <- long_to_condensed(data, columns, readable = TRUE) condensed; }