backup_redcap: Function to run the backup of an entire REDCap data...

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Goal of this is to pull all fields for all records and export this as a single csv. Similar to the download csv functionality of the REDCap UI. Uses the REDCapR tool to accomplish the download.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
backup_redcap(
  cfg,
  protocol,
  out_dir = getwd(),
  mnt_path = NA,
  remote_name = NA,
  remote_path = NA,
  max_attempts = 5,
  trap = FALSE,
  include_timestamp = FALSE
)

Arguments

cfg

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

protocol

is the project we want data from.

out_dir

is the directory to save the output to (Defaults to current)

mnt_path

is the directory to try and remount.

remote_name

is the name of the configured rclone remote.

remote_path

is the path to the remote directory to mount locally.

max_attempts

sets the max number of mount attempts.

trap

if set to TRUE, the mount will not persist after the session.

include_timestamp

will add a timestamp to the saved output.

attempt

sets the attempt number you are on.

Value

An output csv that backs up REDCap data.

Examples

1
2
3
backup_redcap(cfg="/Volumes/bierka_root/datamesh/behav/redcap3.json",
protocol="bsocial", out_dir="/Users/dnplserv/Desktop",
include_timestamp=TRUE)

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