splitForms function

Split a Data Frame into its Forms

Split a Data Frame into its Forms

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

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

Arguments

  • Records: 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).

Examples

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

See Also

Other post-processing functions

recastRecords(),

guessCast(),

guessDate(),

castForImport(),

mChoiceCast(),

widerRepeated()

  • Maintainer: Shawn Garbett
  • License: GPL-2
  • Last published: 2024-10-17