This function is an extension of the `tidyr::spread()` function It can `tidyr::spread()` on multiple keys and values.

reshape_spread(x, variables = "", variables_combine.sep = "_",
  values = c(), id = "", fill = NA)

Arguments

x

dataframe

variables

The variable used for spreading

variables_combine.sep

if using more than one variables column then specifiy how values should be seperated when combined

values

A vector of columns that contain the values

id

What column is not being reorganized and needs to be preserved. Usually "Subject"

fill

Passed to spread() fill parameter

variables_combine.name

If using more than one variables column then specify name of a new combined column

Examples

reshape_spread(x, variables = "variable", values = c("value1", "value2"), by = "Subject")
#> Error in reshape_spread(x, variables = "variable", values = c("value1", "value2"), by = "Subject"): unused argument (by = "Subject")