<!-- Generated by pkgdown: do not edit by hand --><htmllang="en"><head><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"><metacharset="utf-8"><metahttp-equiv="X-UA-Compatible"content="IE=edge"><metaname="viewport"content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Changelog • REDCapCAST</title><!-- favicons --><linkrel="icon"type="image/png"sizes="16x16"href="../favicon-16x16.png"><linkrel="icon"type="image/png"sizes="32x32"href="../favicon-32x32.png"><linkrel="apple-touch-icon"type="image/png"sizes="180x180"href="../apple-touch-icon.png"><linkrel="apple-touch-icon"type="image/png"sizes="120x120"href="../apple-touch-icon-120x120.png"><linkrel="apple-touch-icon"type="image/png"sizes="76x76"href="../apple-touch-icon-76x76.png"><linkrel="apple-touch-icon"type="image/png"sizes="60x60"href="../apple-touch-icon-60x60.png"><scriptsrc="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><metaname="viewport"content="width=device-width, initial-scale=1, shrink-to-fit=no"><linkhref="../deps/bootstrap-5.3.1/bootstrap.min.css"rel="stylesheet"><scriptsrc="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><linkhref="../deps/font-awesome-6.5.2/css/all.min.css"rel="stylesheet"><linkhref="../deps/font-awesome-6.5.2/css/v4-shims.min.css"rel="stylesheet"><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="Changelog"><metaproperty="og:image"content="https://agdamsbo.github.io/REDCapCAST/logo.png"></head><body>
<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 release attempts to solve problems hosting the shiny_cast app, while also implementing functions to preserve as much meta data as possible from the REDCap database when exporting data.</p>
<p>The hosting on shinyapps.io has given a lot of trouble recently. Modified package structure a little around the <code><ahref="../reference/shiny_cast.html">shiny_cast()</a></code>, to accommodate an alternative hosting approach with all package functions included in a script instead of requiring the package.</p>
<ul><li><p>NEW: A new option to <code>raw_or_label</code> in <code>read_readcap_tables()</code> has been added: “both”. Get raw values with REDCap labels applied as labels. Use <code><ahref="../reference/as_factor.html">as_factor()</a></code> to format factors with original labels and use the <code>gtsummary</code> package to easily get beautiful tables with original labels from REDCap. Use <code><ahref="../reference/fct_drop.html">fct_drop()</a></code> to drop empty levels.</p></li>
<li><p>NEW: fct_drop() has been added with an extension to <code><ahref="https://forcats.tidyverse.org/reference/fct_drop.html"class="external-link">forcats::fct_drop()</a></code>, that works across data.frames. Use as <code><ahref="../reference/fct_drop.html">fct_drop()</a></code>.</p></li>
<li><p>CHANGE: the default data export method of <code><ahref="../reference/easy_redcap.html">easy_redcap()</a></code> has been changed to use the new labelled data export with <code>read_readcap_tables()</code>.</p></li>
<p>24.11.1 was rejected on CRAN based on wrong title capitalisation. This was an opportunity to extend the package overhaul. And this actually turned out to be a major step towards a very usable shiny app which have received most of the focus.</p>
<p>I have implemented option to specify categorical variables to factorize, but doing this with a modified version of {forcats} and {haven}’s <code><ahref="../reference/as_factor.html">as_factor()</a></code>, that will preserve any attributes applied to the data to be able to upload and cast REDCap meta data from richly formatted data (use .rds). No matter the input type, all input is parsed using the default options from the {readr} package. Also to avoid mis-labelling, logicals are converted to factors as REDCap truefalse class follows different naming conversion compared to R. Also correct support for variable labels as field labels (use .rds formatted data and label with labelled::var_label())</p>
<p>This package has been detached from the REDCapRITS, which it was originally forked from. The data split function will be kept, while testing will be rewritten. This projects has evolved away from the original fork.</p>
<ul><li><p>Bug: ‘form.name’ specified to ‘ds2dd_detailed()’ was ignored. Corrected to only be ignored if ‘form.sep’ is specified. Added handling of re-occurring <code>form.sep</code> pattern.</p></li>
<li><p>New: <code><ahref="../reference/export_redcap_instrument.html">export_redcap_instrument()</a></code> is a new version of <code><ahref="../reference/create_instrument_meta.html">create_instrument_meta()</a></code>, that will only export a single instrument. Multiple instrument export can be done with <code><ahref="https://rdrr.io/r/base/lapply.html"class="external-link">lapply()</a></code> or <code><ahref="https://purrr.tidyverse.org/reference/map.html"class="external-link">purrr::map()</a></code>. This allows for inclusion of this functionality in the Shiny implementation and is easier to handle. <code><ahref="../reference/create_instrument_meta.html">create_instrument_meta()</a></code> is deprecated.</p></li>
<li><p>Improved: <code><ahref="../reference/shiny_cast.html">shiny_cast()</a></code> app has been updated to actually work if you install the package and not clones the whole repository.</p></li>
<ul><li><p>New: Major overhaul of the app interface with the introduction of <code>bslib</code> for building the page. Also Detailed documentation added for the app workflow.</p></li>
<li><p>New: Export a REDCap instrument ready to add to your database based on an uploaded spreadsheet. This is thanks to the <code><ahref="../reference/export_redcap_instrument.html">export_redcap_instrument()</a></code> function. This functionality is intended for projects in production and adding instruments should be handled manually and not by API upload.</p></li>
<ul><li><p>Fix: <code><ahref="../reference/read_redcap_tables.html">read_redcap_tables()</a></code>: field names testing allows to include “[form_name]_complete” fields.</p></li>
<li><p>Fix: <code><ahref="../reference/ds2dd_detailed.html">ds2dd_detailed()</a></code>: default record ID name is now “record_id”, the REDCap default. Default is still to use the first column name. Support was added to interpret column name prefix or suffix as instrument names. See the examples.</p></li>
<li><p>New: <code><ahref="../reference/create_instrument_meta.html">create_instrument_meta()</a></code>: creates zip with instrument files to allow adding new instruments to project in production. Takes data dictionary as input and creates a zip for each instrument specified by the <code>form_name</code> column.</p></li>
<li><p>New: <code><ahref="../reference/doc2dd.html">doc2dd()</a></code>: function to convert 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. The generic case is a data frame with variable names as values in a column. This is a format like the REDCap data dictionary, but gives a few options for formatting. Has a few related functions for data handling and formatting. One interesting function is <code><ahref="../reference/case_match_regex_list.html">case_match_regex_list()</a></code>, which allows for a dynamic <code><ahref="https://dplyr.tidyverse.org/reference/case_when.html"class="external-link">dplyr::case_when()</a></code>-like approach for regex-matching. I think it is neat at least.</p></li>
<ul><li>Dependencies: In order to deploy <code><ahref="../reference/shiny_cast.html">shiny_cast()</a></code> with <code>shinylive</code>, I need to remove <code>curl</code> as a dependency. To accomplish this, the <code>shiny_deploy()</code> helper functions has been moved to the package <ahref="https://github.com/agdamsbo/project.aid"class="external-link"><code>project.aid</code></a>. This was before realising that <code>REDCapR</code> has <code>curl</code> as dependency, which is the culprit. <code>REDCapCAST</code> is not going to be a <code>shinylive</code> web-app without removing <code>REDCapR</code> dependency or any other REDCap database interaction, which would defy the purpose. I’ll stick to hosted Shiny app instead.</li>
<li><p>Fix: <code><ahref="../reference/easy_redcap.html">easy_redcap()</a></code>: fixed to actually allow project naming. also specifically asks for uri. widening updated to work.</p></li>
<li><p>Fix: <code><ahref="../reference/redcap_wider.html">redcap_wider()</a></code>: updated to accept more formats and allow handling of simple projects without repeating instruments and not longitudinal.</p></li>
<li><p>Fix: <code><ahref="../reference/read_redcap_tables.html">read_redcap_tables()</a></code>: now handles non-longitudinal project without repeatable instruments.</p></li>
<li><p>NEW: <code><ahref="../reference/ds2dd_detailed.html">ds2dd_detailed()</a></code>: extension of the <code><ahref="../reference/ds2dd.html">ds2dd()</a></code>, which serves to preserve as much metadata as possible automatically. Depends on a group of helper functions also introduced. Of special note is the <code><ahref="../reference/guess_time_only_filter.html">guess_time_only_filter()</a></code>, which will try to guess which columns/variables should be formatted as time only formats. Supports hms time format. DETAILED INSTRUCTION AND VIGNETTE IS PENDING.</p></li>
<li><p>NEW: <code><ahref="../reference/read_redcap_instrument.html">read_redcap_instrument()</a></code>: convenience function to retrieve complete instrument. Goes a little against the focused approach. With <code><ahref="https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html"class="external-link">REDCapR::redcap_read()</a></code> you can specify a form to download. You have to also specify the record id variable though. This is done for you with <code><ahref="../reference/read_redcap_instrument.html">read_redcap_instrument()</a></code>. Nothing fancy.</p></li>
<li><p>NEW: <code><ahref="../reference/shiny_cast.html">shiny_cast()</a></code>: <ahref="https://shiny.posit.co/"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. I plan to host the app with shinyapps.io, but for now you can run it locally.</p></li>
<p>I believe <code>renv</code> has now been added and runs correctly. After clone, do <code><ahref="https://rstudio.github.io/renv/reference/restore.html"class="external-link">renv::restore()</a></code> to install all necessary package to modify the package. This seems to always be back and forth. <code>renv</code> may be on its way out again.</p>
<ul><li>Fix: <code><ahref="../reference/read_redcap_tables.html">read_redcap_tables()</a></code>: checking form names based on data dictionary to allow handling of non-longitudinal projects. Prints invalid form names and invalid event names. If invalid form names are supplied to <code><ahref="https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html"class="external-link">REDCapR::redcap_read()</a></code> (which is the backbone), all forms are exported, which is not what we want with a focused approach. Invalid event names will give an output with a rather peculiar formatting. Checking of field names validity is also added.</li>
<ul><li>New: <code><ahref="../reference/easy_redcap.html">easy_redcap()</a></code> function to ease the retrieval of a dataset with <code><ahref="../reference/read_redcap_tables.html">read_redcap_tables()</a></code> with <code>keyring</code>-package based key storage, which handles secure API set, storage and retrieval. Relies on a small helper function, <code><ahref="../reference/get_api_key.html">get_api_key()</a></code>, which wraps relevant <code>keyring</code>-functions. Includes option to cast the data in a wide format with flag <code>widen.data</code>.</li>
<li>Fix: <code><ahref="../reference/REDCap_split.html">REDCap_split()</a></code>: when using this function on its own, supplying a data set with check boxes would fail if metadata is supplied as a tibble. Metadata is now converted to data.frame. Fixed.</li>
<li>Fix: <code><ahref="../reference/read_redcap_tables.html">read_redcap_tables()</a></code>: fixed bug when supplying events.</li>
<ul><li><p>New: <code><ahref="../reference/ds2dd.html">ds2dd()</a></code> function migrating from the <code>stRoke</code>-package. Assists in building a data dictionary for REDCap from a dataset.</p></li>
<li><p>New: <code><ahref="../reference/strsplitx.html">strsplitx()</a></code> function to ease the string splitting as an extension of <code><ahref="https://rdrr.io/r/base/strsplit.html"class="external-link">base::strsplit()</a></code>. Inspiration from <ahref="https://stackoverflow.com/a/11014253/21019325"class="external-link uri">https://stackoverflow.com/a/11014253/21019325</a> and <ahref="https://www.r-bloggers.com/2018/04/strsplit-but-keeping-the-delimiter/"class="external-link uri">https://www.r-bloggers.com/2018/04/strsplit-but-keeping-the-delimiter/</a>.</p></li>
<li><p>New: <code>d2n()</code> function converts single digits to written numbers. Used to sanitize variable and form names in REDCap database creation. For more universal number to word I would suggest <code>english::word()</code> or <code><ahref="https://rdrr.io/pkg/xfun/man/numbers_to_words.html"class="external-link">xfun::numbers_to_words()</a></code>, though I have not been testing these.</p></li>
<p>To reflect new functions and the limitation to only working in R, I have changed the naming of the fork, while still, of course, maintaining the status as a fork.</p>
<p>The versioning has moved to a monthly naming convention.</p>
<p>The main goal this package is to keep the option to only export a defined subset of the whole dataset from the REDCap server as is made possible through the <code><ahref="https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html"class="external-link">REDCapR::redcap_read()</a></code> function, and combine it with the work put into the REDCapRITS package and the handling of longitudinal projects and/or projects with repeated instruments.</p>
<ul><li><p><code><ahref="../reference/read_redcap_tables.html">read_redcap_tables()</a></code><strong>NEW</strong>: this function is mainly an implementation of the combined use of <code>REDCapR::readcap_read()</code> and <code><ahref="../reference/REDCap_split.html">REDCap_split()</a></code> to maintain the focused nature of <code>REDCapR::readcap_read()</code>, to only download the specified data. Also implements tests of valid form names and event names. The usual fall-back solution was to get all data.</p></li>
<li><p><code><ahref="../reference/redcap_wider.html">redcap_wider()</a></code><strong>NEW</strong>: this function pivots the long data frames from <code><ahref="../reference/read_redcap_tables.html">read_redcap_tables()</a></code> using <code><ahref="https://tidyr.tidyverse.org/reference/pivot_wider.html"class="external-link">tidyr::pivot_wider()</a></code>.</p></li>
<li><p><code><ahref="../reference/focused_metadata.html">focused_metadata()</a></code><strong>NEW</strong>: a hidden helper function to enable a focused data acquisition approach to handle only a subset of metadata corresponding to the focused dataset.</p></li>
<ul><li>metadata handling <strong>IMPROVED</strong>: improved handling of different column names in matadata (DataDictionary) from REDCap dependent on whether it is acquired thorugh the api og downloaded from the server.</li>