long2wide {Ymisc} | R Documentation |
Reshapes the data
Description
long2wide() is data-reshaping function for long format data. This function mainly targets the brain structure data that contains the data from the left and right hemispheres
Usage
long2wide(data, ID = "ID", separator = "_", hemisphere = "prefix", start, end)
Arguments
data |
The long format data. |
ID |
The column of identifiers. |
separator |
A character vector that separates characters in the variable names. |
hemisphere |
The character vector that indicates whether a hemisphere indicator in the variable names is the prefix or suffix. At this point, only a "prefix" option is available. |
start |
The column that specifies the starting point of a set of variables to be reshaped. |
end |
The column that specifies the endpoint of a set of variables to be reshaped. |
Value
The wide format data
Examples
data(long)
long2wide(
data=long,
ID="ID",
separator="_",
hemisphere="prefix",
start="region",
end="rh")
[Package Ymisc version 0.1.0 Index]