widenDSS: Create a wide data.frame using reshape2::dcast

View source: R/widen.R

widenDSSR Documentation

Create a wide data.frame using reshape2::dcast

Description

This function transforms the data from long (ex: CDISC) to wide format using the function dcast from the package reshape2.

Usage

widenDSS(
  what,
  measure,
  cols = NULL,
  formula = NULL,
  by.col = NULL,
  completeCases = FALSE,
  fun.aggregate = NULL
)

Arguments

what

a data.frame

measure

name of the column which stores values, this goes straight into the parameter value.var in reshape2::dcast

cols

a vector of columns used in the formula. They must exist in 'what'. If null, all the columns from 'what' will be used.

formula

the formula to use by reshape2::dcast. If left null an attempt will be made to guess it with suggest.pivot.formula.

by.col

typically the patient id, the column that will end up as key of the resulting 'wide' data.frame. In most cases this can be left null as it's been set when the package was loaded

completeCases

a logical, keep only complete cases?

Value

a data.frame in wide format


sib-swiss/dsSwissKnife documentation built on Nov. 27, 2024, 6:03 p.m.