long2wide: Reshapes the data

View source: R/long2wide.R

long2wideR 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")

Ymisc documentation built on Oct. 18, 2023, 5:09 p.m.