Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fieldToVar

Convert a REDCap Data Field to an R Vector


Description

Converts a field exported from REDCap into a valid R vector

Usage

fieldToVar(
  records,
  meta_data,
  factors = TRUE,
  dates = TRUE,
  checkboxLabels = FALSE
)

Arguments

records

A data frame of records returned by exportRecords or exportReports

meta_data

A data frame giving the data dictionary, as returned by exportMetaData

factors

Logical, determines if checkbox, radio button, dropdown and yesno variables are converted to factors

dates

Logical, determines if date variables are converted to POSIXct format

checkboxLabels

Logical, determines if checkbox variables are labeled as "Checked" or using the checkbox label. Only applicable when factors = TRUE

Details

This function is called internally by exportRecords and exportReports. it is not available to the user.

Author(s)

Jeffrey Horner


redcapAPI

Interface to 'REDCap'

v2.3
GPL-2
Authors
Benjamin Nutter [aut, ctb, cre], Stephen Lane [ctb], Will Beasley [ctb], Jeffrey Horner [ctb], Will Gray [ctb], Jeremy Stephens [ctb], Marcus Lehr [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.