mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2024-11-22 13:30:23 +01:00
Improved example for R in README.md
This commit is contained in:
parent
35c03d637d
commit
f3d9e81f05
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user