reshape_data | R Documentation |
Reshaping dataset from wide to long or from long to wide
reshape_data(
data,
data_to = c("long", "wide"),
cols,
names_to = "name",
values_to = "value",
names_from = "name",
values_from = "value"
)
data |
a dataset to reshape |
data_to |
whether the target dataset is |
cols |
columns to gather together (for wide to long) |
names_to |
name for new column containing old names (for wide to long) |
values_to |
name for new column containing old values (for wide to long) |
names_from |
column to spread out (for long to wide) |
values_from |
values to be put in the spread columns (for long to wide) |
reshaped dataset
Zhaoming Su
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.