get_redcap_data: Wrapper function to source and execute a function for...

Description Usage Arguments Value Examples

View source: R/utils.R

Description

This funtion will first attempt to execute a default data fetching for the protocol given that should be named: get_<protocol>_task_data()

Example: get_bsocial_task_data()

If this general function fails, a specific one for that task will be used, which should be name: get_<protocol>_<task>_data()

Example: get_explore2_clock_data()

NOTE: This needs updated to allow selection from user input fields and events instead of only those specified in the lab config file.

Usage

1
get_redcap_data(data, protocol, task, fields = NA, events = NA, cfg = NA)

Arguments

data

a REDCapR data object

protocol

is the project we want data from.

task

is the specific task we want data for.

fields

are REDCap data fields we want to pull. (Default is all fields)

events

are REDCap events we want to pull. (Default is all events)

cfg

is the path to the lab's json configuration file. (Required)

Value

The selected REDCap data.

Examples

1
2
get_redcap_data(data=bs, protocol='bsocial', task='trust', fields=cfg,
events=cfg, cfg='/bgfs/adombrovski/lab_resources/dnpl.json')

DecisionNeurosciencePsychopathology/DataTracker documentation built on Jan. 20, 2022, 4:51 p.m.