| to_long | R Documentation |
A highly intuitive wrapper around stats::reshape designed for
psychological research. It converts data from wide format to long format
by identifying within-subjects factors.
to_long(
data,
within = NULL,
label = NULL,
value = "Value",
id = NULL,
sort = FALSE
)
data |
A data frame in wide format. |
within |
The columns to gather into long format. Can be:
|
label |
The name for the new column that will contain the level names (e.g., "Time").
If NULL, it defaults to the prefix used in |
value |
The name for the new column that will contain the measurement values. Can be a character vector for multiple measurement groups. Default is "Value". |
id |
The identifier columns that should be repeated for each row.
If NULL (default), all columns NOT specified in |
sort |
Logical; if TRUE, sort the output by |
A data frame in long format.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.