transformData {clinDataReview}R Documentation

Transform data.

Description

Transform data from long to wide format. This function converts formats with the stats::reshape function.

Usage

transformData(data, transformations, verbose = FALSE, labelVars = NULL)

Arguments

data

Data.frame with input data to transform.

transformations

Transformations (or list of those) as a list with:

  • 'type': String with type of transformation. Currently, only: 'pivot_wider' is available

  • extra parameters for the transformation, for:

    • 'pivot_wider':

      • 'varsID': Character vector with variable(s) of data defining unique records in the wide format. Corresponds to the idvar parameter of the reshape function.

      • 'varPivot': String with unique variable of data containing elements to pivot in different columns in the wide format (used for column names). Corresponds to the timevar parameter of the reshape function.

      • 'varsValue': Character vector with variable(s) of data used to fill the columns in the wide format. Corresponds to the v.names parameter of the reshape function.

verbose

Logical, if TRUE (FALSE by default) progress messages are printed in the current console. For the visualizations, progress messages during download of subject-specific report are displayed in the browser console.

labelVars

Named character vector containing variable labels.

Value

A data.frame in wide format.

Author(s)

Laure Cougnaud


[Package clinDataReview version 1.5.0 Index]