reshape_data {iNZightTools} | R Documentation |
Reshaping dataset from wide to long or from long to wide
Description
Reshaping dataset from wide to long or from long to wide
Usage
reshape_data(
data,
data_to = c("long", "wide"),
cols,
names_to = "name",
values_to = "value",
names_from = "name",
values_from = "value"
)
Arguments
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) |
Value
reshaped dataset
Author(s)
Zhaoming Su
[Package iNZightTools version 2.0.1 Index]