-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
44 lines (34 loc) · 2.14 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
╔═══════════════════════════════════════════════════════════╗
║ REDCap Metadata Utilities ║
║ R Package for Extracting Information from REDCap Metadata ║
║ ║
║ Version 0.0.1 ║
║ Copyright (c) 2022, Michael Pascale ║
║ MGH Center for Addiction Medicine ║
║ ║
║ MIT Licensed ║
╚═══════════════════════════════════════════════════════════╝
See documentation at https://rcm.psyc.dev for function details.
The purpose of this package is to provide an interface to REDCap datasets with
integrated metadata from the data dictionary. The product is an S3 class which
wraps a dataframe containing REDCap data. Metadata for individual fields is
added to the attributes of each column. A print method and accessors for each
metadata property are provided.
These tools make it easier to work with REDCap data in R without continiously
referencing the REDCap codebook, data dictionary or settings page.
Install from GitHub with `devtools`.
> # install.packages('devtools')
> devtools::install_github('MichaelPascale/rcm')
Instantiate an `rcm_data` object with information downloaded from REDCap.
> library(rcm)
> df_data <- read.csv('data/data-example.csv')
> df_meta <- read.csv('data/dictionary-example.csv')
> df_redcap <- rcm(df_data, df_meta)
> df_redcap
Optionally, include information regarding the REDCap events for each form.
> df_forms <- read.csv('data/form-event-mappings-example.csv')
> df_redcap <- rcm(df_data, df_meta, df_forms)
> df_redcap
Printing the name of any variable in the dataset will display a detailed report
including the field type, label, and validation options selected in REDCap.
> df_redcap$some_scale_q8