This accrual report example is adapted from work I did consulting for the School of Pharmacy at the University of Colorado Denver.
There are three main types of R files used for this report:
-
The file(s) which are of the form "[database name]_R_[date]_[time].r" are read in files generated by REDCAP upon selection of the option to export to R. These files contain information such as variable labels, which variables should be factors, and associated factor levels. These files are not run by the user; rather, they are sourced within file (2), "read in.r".
-
The file "read in.r" is the main file used to import REDCAP datasets, determines which dataset and associated REDCAP read in file in the working directory is the most recent, and performs data cleaning. This file also saves the dataset as a .Rda file under a user-assigned dataset name. This file should be re-run each time a new database has been downloaded from REDCAP.
-
The file "accrual report.r" file generates the accrual PDF and includes some summary statistics and data visualizations.
There are two main types of data files for this report:
-
The file(s) which are of the form "[database name]_DATA_[date]_[time].csv" are the data files generated by REDCAP.
-
The file which is of the form "[database name].Rda" is the file generated by "read in.r", in which [database name] is a user-assigned dataset name.
"read in.r", and the .csv and .r files associated with visits_data have been uploaded. The accrual report R file and PDF, and dose_data files will be uploaded once I generate the rest of the example data and tune the report.