<scriptsrc="deps/headroom-0.11.0/headroom.min.js"></script><scriptsrc="deps/headroom-0.11.0/jQuery.headroom.min.js"></script><scriptsrc="deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><scriptsrc="deps/clipboard.js-2.0.11/clipboard.min.js"></script><scriptsrc="deps/search-1.0.0/autocomplete.jquery.min.js"></script><scriptsrc="deps/search-1.0.0/fuse.min.js"></script><scriptsrc="deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><scriptsrc="pkgdown.js"></script><metaproperty="og:title"content="REDCap Castellated Data Handling">
<metaname="description"content="Originally forked from the R part of REDCapRITS by Paul Egeler. See <https://github.com/pegeler/REDCapRITS>. REDCap database casting and handling of castellated data when using repeated instruments and longitudinal projects. Keeps a focused data export approach, by allowing to only export required data from the database. 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>).">
<metaproperty="og:description"content="Originally forked from the R part of REDCapRITS by Paul Egeler. See <https://github.com/pegeler/REDCapRITS>. REDCap database casting and handling of castellated data when using repeated instruments and longitudinal projects. Keeps a focused data export approach, by allowing to only export required data from the database. 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>).">
<liclass="nav-item"><aclass="external-link nav-link"href="https://github.com/agdamsbo/REDCapCAST/"aria-label="GitHub"><spanclass="fa fab fa-github fa-lg"></span></a></li>
<p>This package is a fork of <ahref="https://github.com/pegeler/REDCapRITS"class="external-link">pegeler/REDCapRITS</a>. 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 <code>REDCap_split</code> function.</p>
<p>I started working on this project as the castellated longitudinal data set was a little challenging. Later, I have come to learn of the <ahref="https://github.com/vubiostat/redcapAPI"class="external-link"><code>redcapAPI</code></a> package, which would also cover this functionality. I find the <code>redcapAPI</code>package 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 <ahref="https://redcap-tools.github.io/"class="external-link">REDCap-Tools</a> for other great tools for working with REDCap in R.</p>
<p>For any more advanced uses, consider using the <code>redcapAPI</code> package.</p>
<li><p><code>REDcap_split()</code>: Works largely as the original <code>REDCapRITS::REDCap_split()</code>. It takes a REDCap dataset and metadata (data dictionary) to split the data set into a list of dataframes of instruments.</p></li>
<li><p><code><ahref="reference/read_redcap_tables.html">read_redcap_tables()</a></code>: wraps the use of <ahref="https://github.com/OuhscBbmc/REDCapR"class="external-link"><code>REDCapR::redcap_read()</code></a> with <code><ahref="reference/REDCap_split.html">REDCap_split()</a></code> to ease the export of REDCap data. Default output is a list of data frames with one data frame for each REDCap instrument.</p></li>
<li><p><code><ahref="reference/redcap_wider.html">redcap_wider()</a></code>: joins and pivots a list of data frames with repeated instruments to a wide format utilizing the <ahref="https://tidyr.tidyverse.org/reference/pivot_wider.html"class="external-link"><code>tidyr::pivot_wider()</code></a> from the <ahref="https://www.tidyverse.org/"class="external-link">tidyverse</a>.</p></li>
<li><p><code><ahref="reference/easy_redcap.html">easy_redcap()</a></code>: combines secure API key storage with the <code>keyring</code>-package, focused data retrieval and optional widening. This is the recommended approach for easy data access and analysis.</p></li>
<li><p><code><ahref="reference/ds2dd_detailed.html">ds2dd_detailed()</a></code>: 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.</p></li>
<li><p><code><ahref="reference/doc2dd.html">doc2dd()</a></code>: 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.</p></li>
<li><p><code><ahref="reference/shiny_cast.html">shiny_cast()</a></code>: <ahref="https://www.rstudio.com/products/shiny/"class="external-link">Shiny</a> 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 <ahref="https://agdamsbo.shinyapps.io/redcapcast/"class="external-link">hosted on shinyapps.io</a><del>while I work on a <ahref="https://posit-dev.github.io/r-shinylive/"class="external-link">shinylive</a> implementation</del>.</p></li>
<p>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.</p>
<h2id="code-of-conduct">Code of Conduct<aclass="anchor"aria-label="anchor"href="#code-of-conduct"></a>
</h2>
<p>Please note that the REDCapCAST project is released with a <ahref="https://agdamsbo.github.io/REDCapCAST/CODE_OF_CONDUCT.html">Contributor Code of Conduct</a>. By contributing to this project, you agree to abide by its terms.</p>
<li><ahref="https://github.com/agdamsbo/REDCapCAST"class="external-link"><imgsrc="https://img.shields.io/github/r-package/v/agdamsbo/REDCapCAST"alt="GitHub R package version"></a></li>
<li><ahref="https://app.codecov.io/gh/agdamsbo/REDCapCAST?branch=master"class="external-link"><imgsrc="https://codecov.io/gh/agdamsbo/REDCapCAST/branch/master/graph/badge.svg"alt="Codecov test coverage"></a></li>