Learn R Programming

redcapAPI (version 2.7.4)

splitForms: Split a Data Frame into its Forms

Description

Separates a data frame from REDCap into a list of data frames where each form constitutes an element in the list.

Usage

splitForms(Records, rcon, envir = NULL, base = NULL, post = NULL)

Arguments

Records

a data.frame such as one generated by exportRecords or exportRecordsTyped

rcon

a redcapConnection object.

envir

environment. The target environment for the resulting list of data.frames. Defaults to NULL which returns the a list. Use globalenv to assign the global environment. Will accept a number of the environment.

base

character(1) giving the start of the naming scheme for the elements of the list. By default, the names of the list will be the form names. If this value is provided, it will follow the format base.form_name.

post

function to apply to each element of form data after separating them, must be of signature `function(data, rcon)`.