REDCap Castellated data handling https://agdamsbo.github.io/REDCapCAST/
Go to file
2024-06-07 14:20:22 +02:00
.github major update with new functions and renv is out! see NEWS section 2024-06-07 10:35:38 +02:00
app minor app updates 2024-06-07 12:01:09 +02:00
data documented dataset for shiny testing 2024-02-27 12:43:29 +01:00
data-raw linting 2024-02-27 13:20:21 +01:00
inst major update with new functions and renv is out! see NEWS section 2024-06-07 10:35:38 +02:00
man major update with new functions and renv is out! see NEWS section 2024-06-07 10:35:38 +02:00
pkgdown/favicon updated description, icon on favicons ✌️🧢 2023-06-02 12:07:20 +02:00
R major update with new functions and renv is out! see NEWS section 2024-06-07 10:35:38 +02:00
renv major overhaul with new functions. docs are lacking 2024-05-02 13:31:21 +02:00
test-data/test_splitr formatting 2024-02-06 14:15:36 +01:00
tests minor 2024-06-07 11:16:58 +02:00
vignettes minor 2024-06-07 11:16:58 +02:00
_pkgdown.yml new workflow 2023-07-04 16:58:12 +02:00
.gitignore ignere comments 2024-06-07 14:20:22 +02:00
.Rbuildignore added code of conduct 2024-02-27 14:18:23 +01:00
.Renviron new version 2023.12.1 with two bug fixes and a new wrapper function 2023-12-20 09:01:40 +01:00
.Rprofile major update with new functions and renv is out! see NEWS section 2024-06-07 10:35:38 +02:00
CODE_OF_CONDUCT.md Update CODE_OF_CONDUCT.md 2024-02-28 14:19:29 +01:00
codecov.yml page, test and coverage 2023-03-08 11:50:44 +01:00
cran-comments.md new comments 2024-06-07 11:22:41 +02:00
DESCRIPTION major update with new functions and renv is out! see NEWS section 2024-06-07 10:35:38 +02:00
LICENSE.md license 2023-03-08 20:18:39 +01:00
NAMESPACE major overhaul with new functions. docs are lacking 2024-05-02 13:31:21 +02:00
NEWS.md correct link 2024-06-07 14:18:43 +02:00
README.md badge 2024-06-07 11:02:03 +02:00
REDCapCAST.Rproj error on spellchecking 2024-02-27 12:45:53 +01:00
renv.lock major update with new functions and renv is out! see NEWS section 2024-06-07 10:35:38 +02:00

GitHub R package version CRAN/METACRAN DOI R-hub R-CMD-check Page deployed Codecov test coverage CRAN downloads Lifecycle:
experimental

REDCapCAST package

REDCap database casting and handling of castellated data when using repeated instruments and longitudinal projects.

This package is a fork of pegeler/REDCapRITS. The REDCapRITS represents great and extensive work to handle castellated REDCap data in different programming languages. This fork is purely minded on R usage and includes a few implementations of the main REDCap_split function.

I started working on this project as the castellated longitudinal data set was a little challenging. Later, I have come to learn of the redcapAPI package, which would also cover this functionality. I find the redcapAPIpackage quite advanced and a little difficult to work with. This have led to the continued work on this package, as an easy-to-use approach for data migration, data base creation and data handling. This package is very much to be seen as an attempt at a R-to-REDCap-to-R foundry for handling both the transition from dataset/variable list to database and the other way, from REDCap database to a tidy dataset. The goal was also to allow for a "minimal data" approach by allowing to filter records, instruments and variables in the export to only download data needed. I think this approach is desirable for handling sensitive, clinical data. Please refer to REDCap-Tools for other great tools for working with REDCap in R.

For any more advanced uses, consider using the redcapAPI package.

Use and immprovements

Here is just a short description of the main functions:

  • REDcap_split(): Works largely as the original REDCapRITS::REDCap_split(). It takes a REDCap dataset and metadata (data dictionary) to split the data set into a list of dataframes of instruments.

  • read_redcap_tables(): wraps the use of REDCapR::redcap_read() with REDCap_split() to ease the export of REDCap data. Default output is a list of data frames with one data frame for each REDCap instrument.

  • redcap_wider(): joins and pivots a list of data frames with repeated instruments to a wide format utilizing the tidyr::pivot_wider() from the tidyverse.

  • easy_redcap(): combines secure API key storage with the keyring-package, focused data retrieval and optional widening. This is the recommended approach for easy data access and analysis.

  • ds2dd_detailed(): Converts a data set to a data dictionary for upload to a new REDCap database. Variables (fields) and instruments in a REDCap data base are defined by this data dictionary.

  • doc2dd(): Converts a document table to data dictionary. This allows to specify instrument or whole data dictionary in text document, which for most is easier to work with and easily modifiable. Very much like a easy version of just working directly in the data dictionary file itself.

  • shiny_cast(): Shiny application to ease the process of converting a spreadsheet/data set to a REDCap database. The app runs locally and data is transferred securely. You can just create and upload the data dictionary, but you can also transfer the given data in the same process. The app is hosted on shinyapps.io while I work on a shinylive implementation.

Future

The plan with this package is to be bundled with a Handbook on working with REDCap from R. This work is in progress but is limited by the time available. Please feel free to contact me or create and issue with ideas for future additions.

Installation

The package is available on CRAN. Install the latest version:

install.packages("REDCapCAST")

Install the latest version directly from GitHub:

pak::pak("agdamsbo/REDCapCAST")

Code of Conduct

Please note that the REDCapCAST project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.