Package: REDCapCAST 25.1.1

REDCapCAST: REDCap Metadata Casting and Castellated Data Handling

Casting metadata for REDCap database creation and handling of castellated data using repeated instruments and longitudinal projects in 'REDCap'. Keeps a focused data export approach, by allowing to only export required data from the database. Also for casting new REDCap databases based on datasets from other sources. Originally forked from the R part of 'REDCapRITS' by Paul Egeler. See <https://github.com/pegeler/REDCapRITS>. 'REDCap' (Research Electronic Data Capture) is a secure, web-based software platform designed to support data capture for research studies, providing 1) an intuitive interface for validated data capture; 2) audit trails for tracking data manipulation and export procedures; 3) automated export procedures for seamless data downloads to common statistical packages; and 4) procedures for data integration and interoperability with external sources (Harris et al (2009) <doi:10.1016/j.jbi.2008.08.010>; Harris et al (2019) <doi:10.1016/j.jbi.2019.103208>).

Authors:Andreas Gammelgaard Damsbo [aut, cre], Paul Egeler [aut]

REDCapCAST_25.1.1.tar.gz
REDCapCAST_25.1.1.zip(r-4.5)REDCapCAST_25.1.1.zip(r-4.4)REDCapCAST_25.1.1.zip(r-4.3)
REDCapCAST_25.1.1.tgz(r-4.5-any)REDCapCAST_25.1.1.tgz(r-4.4-any)REDCapCAST_25.1.1.tgz(r-4.3-any)
REDCapCAST_25.1.1.tar.gz(r-4.5-noble)REDCapCAST_25.1.1.tar.gz(r-4.4-noble)
REDCapCAST_25.1.1.tgz(r-4.4-emscripten)REDCapCAST_25.1.1.tgz(r-4.3-emscripten)
REDCapCAST.pdf |REDCapCAST.html
REDCapCAST/json (API)
NEWS

# Install 'REDCapCAST' in R:
install.packages('REDCapCAST', repos = c('https://agdamsbo.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/agdamsbo/redcapcast/issues

Pkgdown site:https://agdamsbo.github.io

Datasets:

On CRAN:

5.96 score 1 stars 16 scripts 328 downloads 56 exports 101 dependencies

Last updated 20 days agofrom:3eea26223b. Checks:8 OK. Indexed: yes.

TargetResultLatest binary
Doc / VignettesOKJan 29 2025
R-4.5-winOKJan 29 2025
R-4.5-macOKJan 29 2025
R-4.5-linuxOKJan 29 2025
R-4.4-winOKJan 29 2025
R-4.4-macOKJan 29 2025
R-4.3-winOKJan 29 2025
R-4.3-macOKJan 29 2025

Exports:all_naapply_factor_labelsapply_field_labelas_factorcase_match_regex_listcast_data_overviewcast_meta_overviewchar2choicechar2condclean_field_labelclean_redcap_namecompact_veccreate_html_tablecreate_instrument_metacut_string_lengthd2wdoc2ddds2ddds2dd_detailedeasy_redcapexport_redcap_instrumentfct_dropfct2numfile_extensionfocused_metadataformat_redcap_factorformat_subheaderget_api_keyget_attrguess_time_onlyguess_time_only_filterhaven_all_levelshtml_tag_wrapis_repeated_longitudinalis.labelledmatch_fields_to_formnamed_levelsnav_bar_pagenumchar2fctparse_datapossibly_numericpossibly_romanprocess_user_inputread_inputread_redcap_instrumentread_redcap_tablesREDCap_splitredcap_widersanitize_splitset_attrshiny_castsplit_non_repeating_formsstrsplitxsuffix2labelvar2fctvec2choice

Dependencies:askpassassertthatbackportsbase64encbigDbitbit64bitopsbslibcachemcardscellrangercheckmateclicliprcolorspacecommonmarkcpp11crayoncurldigestdplyrevaluatefansifarverfastmapfilelockfontawesomeforcatsfsgenericsgluegtgtsummaryhavenherehighrhmshtmltoolshtmlwidgetshttpuvhttrjquerylibjsonlitejuicyjuicekeyringknitrlabelinglaterlifecyclemagrittrmarkdownmemoisemimemintymunsellopensslopenxlsx2pillarpkgconfigprettyunitsprogresspromisespurrrR6rappdirsRColorBrewerRcppreactablereactRreadODSreadrREDCapRrematchrlangrmarkdownrprojrootsassscalesshinysodiumsourcetoolsstringistringrsystibbletidyrtidyselecttinytextzdbutf8V8vctrsviridisLitevroomwithrxfunxml2xtableyamlzip

Database-creation

Rendered fromDatabase-creation.Rmdusingknitr::rmarkdownon Jan 29 2025.

Last update: 2024-11-26
Started: 2024-02-27

REDCapCAST

Rendered fromREDCapCAST.Rmdusingknitr::rmarkdownon Jan 29 2025.

Last update: 2025-01-29
Started: 2024-11-18

Shiny-app

Rendered fromShiny-app.Rmdusingknitr::rmarkdownon Jan 29 2025.

Last update: 2024-11-27
Started: 2024-02-27

Readme and manuals

Help Manual

Help pageTopics
Check if vector is all NAall_na
Preserve all factor levels from REDCap data dictionary in data exportapply_factor_labels
Apply REDCap filed labels to data frameapply_field_label
Convert labelled vectors to factors while preserving attributesas_factor as_factor.character as_factor.data.frame as_factor.factor as_factor.haven_labelled as_factor.labelled as_factor.logical as_factor.numeric
List-base regex case_whencase_match_regex_list
Overview of REDCapCAST data for shinycast_data_overview
Overview of REDCapCAST meta data for shinycast_meta_overview
Simple function to generate REDCap choices from character vectorchar2choice
Simple function to generate REDCap branching logic from character vectorchar2cond
Very simple function to remove rich text formatting from field label and save the first paragraph ('<p>...</p>').clean_field_label
clean_redcap_nameclean_redcap_name
Compacting a vector of any length with or without namescompact_vec
Create two-column HTML table for data piping in REDCap instrumentscreate_html_table
DEPRICATED Create zips file with necessary content based on data setcreate_instrument_meta
Cut string to desired lengthcut_string_length
Convert single digits to wordsd2w
Doc table to data dictionary - EARLY, DOCS MISSINGdoc2dd
(DEPRECATED) Data set to data dictionary functionds2dd
Extract data from stata file for data dictionaryds2dd_detailed
Secure API key storage and data acquisition in oneeasy_redcap
Creates zip-file with necessary content to manually add instrument to databaseexport_redcap_instrument
Drop unused levels preserving label datafct_drop fct_drop.data.frame fct_drop.factor
Allows conversion of factor to numeric values preserving original levelsfct2num
DEPRECATED Helper to import files correctlyfile_extension
focused_metadatafocused_metadata
Converts REDCap choices to factor levels and stores in labels attributeformat_redcap_factor
Sub-header formatting wrapperformat_subheader
Retrieve project API key if stored, if not, set and retrieveget_api_key
Extract attribute. Returns NA if noneget_attr
Get the id nameget_id_name
Guess time variables based on naming patternguess_time_only
Try at determining which are true time only variablesguess_time_only_filter
Finish incomplete haven attributes substituting missings with valueshaven_all_levels
Change "hms" to "character" for REDCap upload.hms2character
Simple html tag wrapping for REDCap text formattinghtml_tag_wrap
Multi missing checkis_missing
Test if repeatable or longitudinalis_repeated_longitudinal
Tests for multiple label classesis.labelled
Completion marking based on completed uploadmark_complete
Match fields to formsmatch_fields_to_form
mtcars dataset slightly modified to use for Shiny app upload demonstrationmtcars_redcap
Get named vector of factor levels and valuesnamed_levels
Nav_bar defining function for shiny uinav_bar_page
Applying var2fct across data setnumchar2fct
Helper to auto-parse un-formatted data with haven and readrparse_data
Tests if vector can be interpreted as numeric without introducing NAs by coercionpossibly_numeric
Test if vector can be interpreted as roman numeralspossibly_roman
User input processingprocess_user_input
User input processing characterprocess_user_input.character
User input processing data.frameprocess_user_input.data.frame
User input processing defaultprocess_user_input.default
User input processing responseprocess_user_input.response
Flexible file import based on extensionread_input
Convenience function to download complete instrument, using token storage in keyring.read_redcap_instrument
Download REDCap dataread_redcap_tables
Split REDCap repeating instruments table into multiple tablesREDCap_split
Transforms list of REDCap data.frames to a single wide data.frameredcap_wider
Data set for demonstrationredcapcast_data
REDCap metadata from data baseredcapcast_meta
Replace curly apostrophes and quotes from wordreplace_curly_quote
Sanitize list of data framessanitize_split
Set attributes for named attribute. Appends if attr is NULLset_attr
Launch the included Shiny-app for database casting and uploadshiny_cast
Split a data frame into separate tables for each formsplit_non_repeating_forms
Extended string splittingstrsplitx
Transfer variable name suffix to label in widened datasuffix2label
Correction based on time_only_filter functiontime_only_correction
Convert vector to factor based on threshold of number of unique levelsvar2fct
Named vector to REDCap choices (`wrapping compact_vec()`)vec2choice