have_data: Wrapper function to check

Description Usage Arguments Value Examples

View source: R/utils.R

Description

This funtion will attempt to execute a check for the data of the given modality that should be named: have_<modality>_data()

Example: have_behavior_data()

Usage

1
2
3
4
5
6
7
8
9
have_data(
  cfg,
  modality,
  local_root = "",
  data_path = NA,
  my_required = NA,
  drop_failed = FALSE,
  ...
)

Arguments

cfg

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

modality

is the modality of data to check (example: behavior)

local_root

is the root directory to start checking from.

data_path

is the path from the local_root to the data.

my_required

is a subset of the requirements from cfg.

drop_failed

will drop subjects without data if set to TRUE.

Value

Returns a dataframe of the modality of data requested.

Examples

1
2
3
have_data(cfg='/Volumes/bierka_root/datamesh/behav/redcap3.json',
modality='behavior', protocol='bsocial', task='trust', local_root='/Volumes',
my_required = c("edat_scan", "text_scan"), drop_failed=TRUE)

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