long2wide {faux} | R Documentation |
Convert data from long to wide format
Description
Convert data from long to wide format
Usage
long2wide(
data,
within = c(),
between = c(),
dv = "y",
id = "id",
sep = faux_options("sep")
)
Arguments
data |
the tbl in long format |
within |
the names of the within column(s) |
between |
the names of between column(s) (optional) |
dv |
the name of the DV (value) column |
id |
the names of the column(s) for grouping observations |
sep |
separator for factor levels |
Value
a tbl in wide format
Examples
df_long <- sim_design(2, 2, long = TRUE)
long2wide(df_long, "A", "B")
[Package faux version 1.2.1 Index]