From f3d9e81f054c859128d9e36576b2b244e3a76f9c Mon Sep 17 00:00:00 2001 From: "Egeler, Paul W" Date: Mon, 15 Oct 2018 13:46:26 -0400 Subject: [PATCH] Improved example for R in README.md --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e96aeee..6b0113f 100644 --- a/README.md +++ b/README.md @@ -229,16 +229,12 @@ REDCapRITS::REDCap_split(records, metadata) REDCapRITS also works with the data export script (a.k.a., *syntax file*) supplied by REDCap. Here is an example of its usage: ```r -# You must set the working directory first since the REDCap data export script -# contains relative file references. -setwd("/path/to/data/") - # Run the data export script supplied by REDCap. # This will create a data.frame of your records called 'data' -source("ExampleProject_R_2018-06-03_1700.r") +source("/path/to/data/ExampleProject_R_2018-06-03_1700.r", chdir = TRUE) # Get the metadata -metadata <- read.csv("ExampleProject_DataDictionary_2018-06-03.csv") +metadata <- read.csv("/path/to/metadata/ExampleProject_DataDictionary_2018-06-03.csv") # Split the tables REDCapRITS::REDCap_split(data, metadata)