widerRepeated: Transform Data Into Wide Format

View source: R/widerRepeated.R

widerRepeatedR Documentation

Transform Data Into Wide Format

Description

Converts a dataframe into wide format given a single REDCap form. This function assumes that the Records argument is the result of exportRecordsTyped, and that all empty values have been previously dropped. This will only widen data frames that have a unique identification variable (e.g. 'record_id'), "redcap_event_name" and "redcap_repeat_instrument" in the fields. Otherwise, the data passed in will be returned unchanged.

Usage

widerRepeated(Records, rcon)

Arguments

Records

data.frame containing the records from exportRecordsTyped()

rcon

A redcapConnection object.

See Also

Other post-processing functions

recastRecords(),
guessCast(),
guessDate(),
castForImport(),
mChoiceCast(),
splitForms()

Examples

## Not run: 
unlockREDCap(connections = c(rcon = "project_alias"), 
             url = "your_redcap_url", 
             keyring = "API_KEYs", 
             envir = globalenv())
             
Records <- exportRecordsTyped(rcon)

widerRepeated(Records, rcon)

## End(Not run)


redcapAPI documentation built on Sept. 13, 2023, 1:07 a.m.