mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2024-12-05 02:21:54 +01:00
Deploying to gh-pages from @ agdamsbo/REDCapCAST@30d82e5288 🚀
This commit is contained in:
parent
c9a65bfc2a
commit
4fe8a0d73c
@ -74,14 +74,54 @@
|
||||
|
||||
<div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://github.com/agdamsbo/REDCapCAST" class="external-link">REDCapCAST</a></span><span class="op">)</span></span></code></pre></div>
|
||||
<p>This vignette covers the included functions and basic
|
||||
functionality.</p>
|
||||
<p>A dataset and a meta data file are provided with the package for
|
||||
demonstration of the functions.</p>
|
||||
<p>This vignette covers the basics to get you started with the two basic
|
||||
features of REDCapCAST:</p>
|
||||
<ul>
|
||||
<li><p>Casting REDCap metadata to create a new REDCap database or extend
|
||||
an existing with a new instrument</p></li>
|
||||
<li><p>Reading REDCap data in a convenient and focused way, by only
|
||||
getting the data you need, while preserving as much metadata as
|
||||
possible.</p></li>
|
||||
</ul>
|
||||
<div class="section level2">
|
||||
<h2 id="casting-meta-data">Casting meta data<a class="anchor" aria-label="anchor" href="#casting-meta-data"></a>
|
||||
</h2>
|
||||
<p>The easiest way is to use the <code><a href="../reference/shiny_cast.html">shiny_cast()</a></code>. You can
|
||||
access a <a href="https://agdamsbo.shinyapps.io/redcapcast/" class="external-link">hosted
|
||||
version here</a> or launch it locally like this:</p>
|
||||
<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="fu"><a href="../reference/shiny_cast.html">shiny_cast</a></span><span class="op">(</span><span class="op">)</span></span></code></pre></div>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="reading-data-from-redcap">Reading data from REDCap<a class="anchor" aria-label="anchor" href="#reading-data-from-redcap"></a>
|
||||
</h2>
|
||||
<p>To get you started, the easiest way possible, you can use the
|
||||
<code><a href="../reference/easy_redcap.html">easy_redcap()</a></code> function (example below).</p>
|
||||
<p>You will need an API-key for your REDCap server, the uri/URL/address
|
||||
for the API connection (usually “<a href="https://redcap.YOUR-institution.site/api/" class="external-link uri">https://redcap.YOUR-institution.site/api/</a>”).</p>
|
||||
<p>This function includes a few convenience features to ease your
|
||||
further work.</p>
|
||||
<p>If your project uses repeating instruments possible as a longitudinal
|
||||
project, you can choose to widen the data. If not, the result will be a
|
||||
list of each instrument you have chosen to extract data from. Make sure
|
||||
to specify only the fields or instruments you need, and avoid to save
|
||||
any of the data locally, but always source from REDCap to avoid possibly
|
||||
insecure local storage of sensitive data.</p>
|
||||
<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="fu"><a href="../reference/easy_redcap.html">easy_redcap</a></span><span class="op">(</span>uri <span class="op">=</span> <span class="st">"YOUR URI"</span>, </span>
|
||||
<span> project.name <span class="op">=</span> <span class="st">"MY_PROJECT"</span>, </span>
|
||||
<span> widen.data <span class="op">=</span> <span class="cn">TRUE</span>,</span>
|
||||
<span> fields <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"record_id"</span>, <span class="st">"OTHER FIELDS"</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="splitting-the-dataset">Splitting the dataset<a class="anchor" aria-label="anchor" href="#splitting-the-dataset"></a>
|
||||
</h2>
|
||||
<div class="sourceCode" id="cb2"><pre class="downlit sourceCode r">
|
||||
<p>The <code><a href="../reference/easy_redcap.html">easy_redcap()</a></code> function does a few things under the
|
||||
hood. Below are a few examples to show how the nicely formatted output
|
||||
is achieved.</p>
|
||||
<p>A sample dataset and Data Dictionary/metadata is provided for this
|
||||
demonstration:</p>
|
||||
<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="va">redcapcast_data</span> <span class="op">|></span> <span class="fu">gt</span><span class="fu">::</span><span class="fu"><a href="https://gt.rstudio.com/reference/gt.html" class="external-link">gt</a></span><span class="op">(</span><span class="op">)</span></span></code></pre></div>
|
||||
<div id="mwlefoodfi" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
|
||||
<style>#mwlefoodfi table {
|
||||
@ -1291,7 +1331,7 @@ demonstration of the functions.</p>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="va">redcapcast_meta</span> <span class="op">|></span> <span class="fu">gt</span><span class="fu">::</span><span class="fu"><a href="https://gt.rstudio.com/reference/gt.html" class="external-link">gt</a></span><span class="op">(</span><span class="op">)</span></span></code></pre></div>
|
||||
<div id="eexombwkke" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
|
||||
<style>#eexombwkke table {
|
||||
@ -2189,136 +2229,723 @@ Note: as opposed to the build in datediff() this handles counting years as integ
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
|
||||
<p>To save the metadata as labels in the dataset, we can save field
|
||||
labels and the choices from radio buttons and dropdown features:</p>
|
||||
<div class="sourceCode" id="cb6"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="va">labelled_data</span> <span class="op"><-</span> </span>
|
||||
<span> <span class="fu"><a href="../reference/apply_field_label.html">apply_field_label</a></span><span class="op">(</span>data<span class="op">=</span><span class="va">redcapcast_data</span>,</span>
|
||||
<span> meta<span class="op">=</span><span class="va">redcapcast_meta</span><span class="op">)</span> <span class="op">|></span> </span>
|
||||
<span> <span class="fu"><a href="../reference/apply_factor_labels.html">apply_factor_labels</a></span><span class="op">(</span>meta<span class="op">=</span><span class="va">redcapcast_meta</span><span class="op">)</span></span></code></pre></div>
|
||||
<p>The <code>REDCap_split</code> function splits the data set into a
|
||||
list of data.frames.</p>
|
||||
<div class="sourceCode" id="cb7"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="va">list</span> <span class="op"><-</span></span>
|
||||
<span> <span class="fu"><a href="../reference/REDCap_split.html">REDCap_split</a></span><span class="op">(</span></span>
|
||||
<span> records <span class="op">=</span> <span class="va">redcapcast_data</span>,</span>
|
||||
<span> records <span class="op">=</span> <span class="va">labelled_data</span>,</span>
|
||||
<span> metadata <span class="op">=</span> <span class="va">redcapcast_meta</span>,</span>
|
||||
<span> forms <span class="op">=</span> <span class="st">"all"</span></span>
|
||||
<span> <span class="op">)</span> <span class="op">|></span> </span>
|
||||
<span> <span class="co"># Next steps cleans up and removes generic columns</span></span>
|
||||
<span> <span class="fu"><a href="../reference/sanitize_split.html">sanitize_split</a></span><span class="op">(</span><span class="op">)</span></span>
|
||||
<span><span class="fu"><a href="https://rdrr.io/r/utils/str.html" class="external-link">str</a></span><span class="op">(</span><span class="va">list</span><span class="op">)</span></span>
|
||||
<span><span class="co">#> List of 4</span></span>
|
||||
<span><span class="co">#> List of 3</span></span>
|
||||
<span><span class="co">#> $ baseline_data_start: tibble [6 × 14] (S3: tbl_df/tbl/data.frame)</span></span>
|
||||
<span><span class="co">#> ..$ record_id : num [1:6] 1 2 3 4 5 6</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "label")= chr "ID"</span></span>
|
||||
<span><span class="co">#> ..$ redcap_event_name : chr [1:6] "inclusion" "inclusion" "inclusion" "inclusion" ...</span></span>
|
||||
<span><span class="co">#> ..$ cpr : chr [1:6] "1203401OB4" "0102342303" "2301569823" "0204051342" ...</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "label")= chr "CPR (Danish civil registration number)"</span></span>
|
||||
<span><span class="co">#> ..$ inclusion : Date[1:6], format: "2023-03-13" "2023-03-01" ...</span></span>
|
||||
<span><span class="co">#> ..$ inclusion_time : 'hms' num [1:6] 12:38:49 10:38:57 12:01:07 20:39:19 ...</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "units")= chr "secs"</span></span>
|
||||
<span><span class="co">#> ..$ dob : Date[1:6], format: "1940-03-12" "1934-02-01" ...</span></span>
|
||||
<span><span class="co">#> ..$ age : num [1:6] 83 89.1 66.1 117.9 126.2 ...</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "label")= chr "Age\r\nNote: Apparently, the build in datediff() function does not handle counting whole years. This results in"| __truncated__</span></span>
|
||||
<span><span class="co">#> ..$ age_integer : num [1:6] 83 89 66 117 126 91</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "label")= chr "Age integer\r\nNote: as opposed to the build in datediff() this handles counting years as integers very well. C"| __truncated__</span></span>
|
||||
<span><span class="co">#> ..$ sex : chr [1:6] "female" "male" "male" "female" ...</span></span>
|
||||
<span><span class="co">#> ..$ cohabitation : chr [1:6] "Yes" "Yes" "No" NA ...</span></span>
|
||||
<span><span class="co">#> ..$ hypertension : chr [1:6] "No" "No" "Yes" NA ...</span></span>
|
||||
<span><span class="co">#> ..$ diabetes : chr [1:6] "Yes" "No" "Yes" NA ...</span></span>
|
||||
<span><span class="co">#> ..$ region : chr [1:6] "East" "South" "North" NA ...</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "label")= chr "Legal sex"</span></span>
|
||||
<span><span class="co">#> ..$ cohabitation : 'labelled' chr [1:6] "Yes" "Yes" "No" NA ...</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "label")= chr "Cohabitation"</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "labels")= Named chr [1:2] "1" "2"</span></span>
|
||||
<span><span class="co">#> .. .. ..- attr(*, "names")= chr [1:2] "Yes" "No"</span></span>
|
||||
<span><span class="co">#> ..$ hypertension : 'labelled' chr [1:6] "No" "No" "Yes" NA ...</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "label")= chr "Hypertension"</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "labels")= Named chr [1:2] "1" "2"</span></span>
|
||||
<span><span class="co">#> .. .. ..- attr(*, "names")= chr [1:2] "Yes" "No"</span></span>
|
||||
<span><span class="co">#> ..$ diabetes : 'labelled' chr [1:6] "Yes" "No" "Yes" NA ...</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "label")= chr "Diabetes"</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "labels")= Named chr [1:2] "1" "2"</span></span>
|
||||
<span><span class="co">#> .. .. ..- attr(*, "names")= chr [1:2] "Yes" "No"</span></span>
|
||||
<span><span class="co">#> ..$ region : 'labelled' chr [1:6] "East" "South" "North" NA ...</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "label")= chr "Region"</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "labels")= Named chr [1:4] "1" "2" "3" "4"</span></span>
|
||||
<span><span class="co">#> .. .. ..- attr(*, "names")= chr [1:4] "North" "East" "South" "West"</span></span>
|
||||
<span><span class="co">#> ..$ baseline_data_start_complete: chr [1:6] "Incomplete" "Incomplete" "Incomplete" "Incomplete" ...</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "problems")=<externalptr> </span></span>
|
||||
<span><span class="co">#> $ mrs : tibble [5 × 6] (S3: tbl_df/tbl/data.frame)</span></span>
|
||||
<span><span class="co">#> ..$ record_id : num [1:5] 1 2 2 3 3</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "label")= chr "ID"</span></span>
|
||||
<span><span class="co">#> ..$ redcap_event_name: chr [1:5] "inclusion" "inclusion" "follow1" "follow1" ...</span></span>
|
||||
<span><span class="co">#> ..$ mrs_assessed : chr [1:5] "Yes" "Yes" "Yes" "Yes" ...</span></span>
|
||||
<span><span class="co">#> ..$ mrs_assessed : 'labelled' chr [1:5] "Yes" "Yes" "Yes" "Yes" ...</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "label")= chr "Assesed"</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "labels")= Named chr [1:2] "1" "2"</span></span>
|
||||
<span><span class="co">#> .. .. ..- attr(*, "names")= chr [1:2] "Yes" "No"</span></span>
|
||||
<span><span class="co">#> ..$ mrs_date : Date[1:5], format: "2023-03-13" "2023-03-07" ...</span></span>
|
||||
<span><span class="co">#> ..$ mrs_score : num [1:5] 1 1 3 2 1</span></span>
|
||||
<span><span class="co">#> ..$ mrs_score : 'labelled' num [1:5] 1 1 3 2 1</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "label")= chr "mRS score"</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "labels")= Named chr [1:6] "0" "1" "2" "3" ...</span></span>
|
||||
<span><span class="co">#> .. .. ..- attr(*, "names")= chr [1:6] "0" "1" "2" "3" ...</span></span>
|
||||
<span><span class="co">#> ..$ mrs_complete : chr [1:5] "Incomplete" "Incomplete" "Incomplete" "Incomplete" ...</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "problems")=<externalptr> </span></span>
|
||||
<span><span class="co">#> $ consensus : tibble [0 × 5] (S3: tbl_df/tbl/data.frame)</span></span>
|
||||
<span><span class="co">#> ..$ record_id : num(0) </span></span>
|
||||
<span><span class="co">#> ..$ redcap_event_name : chr(0) </span></span>
|
||||
<span><span class="co">#> ..$ con_mrs : logi(0) </span></span>
|
||||
<span><span class="co">#> ..$ con_calc : logi(0) </span></span>
|
||||
<span><span class="co">#> ..$ consensus_complete: chr(0) </span></span>
|
||||
<span><span class="co">#> ..- attr(*, "problems")=<externalptr> </span></span>
|
||||
<span><span class="co">#> $ new_event : tibble [13 × 8] (S3: tbl_df/tbl/data.frame)</span></span>
|
||||
<span><span class="co">#> ..$ record_id : num [1:13] 2 3 3 3 3 3 4 4 4 4 ...</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "label")= chr "ID"</span></span>
|
||||
<span><span class="co">#> ..$ redcap_event_name : chr [1:13] "follow1" "follow1" "follow1" "follow2" ...</span></span>
|
||||
<span><span class="co">#> ..$ redcap_repeat_instrument: chr [1:13] "new_event" "new_event" "new_event" "new_event" ...</span></span>
|
||||
<span><span class="co">#> ..$ redcap_repeat_instance : num [1:13] 1 1 2 1 2 3 1 2 1 2 ...</span></span>
|
||||
<span><span class="co">#> ..$ event_datetime : POSIXct[1:13], format: "2024-01-18 12:49:42" "2024-01-18 12:49:58" ...</span></span>
|
||||
<span><span class="co">#> ..$ event_age : num [1:13] NA NA NA NA NA NA 96 105 118 118 ...</span></span>
|
||||
<span><span class="co">#> ..$ event_type : chr [1:13] "TIA" "AIS" "ICH" "ICH" ...</span></span>
|
||||
<span><span class="co">#> ..$ new_event_complete : chr [1:13] "Incomplete" "Incomplete" "Incomplete" "Incomplete" ...</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "problems")=<externalptr></span></span></code></pre></div>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="reading-data-from-redcap">Reading data from REDCap<a class="anchor" aria-label="anchor" href="#reading-data-from-redcap"></a>
|
||||
</h2>
|
||||
<p>This function wraps all the above demonstrated function to get the
|
||||
dataset, the metadata, apply the <code>REDCap_split</code>function and
|
||||
then a bit of cleaning. It just cuts outs all the steps for an easier
|
||||
approach.</p>
|
||||
<p>The function works very similar to the
|
||||
<code><a href="https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html" class="external-link">REDCapR::redcap_read()</a></code> in allowing to specify fields,
|
||||
events and forms for export instead of exporting the whole database and
|
||||
filtering afterwards. I believe this is a better and safer, focused
|
||||
approach.</p>
|
||||
<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="co"># read_redcap_tables(uri = "YOUR URI", token = "YOUR TOKEN")</span></span></code></pre></div>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="pivotting-to-wider-format">Pivotting to wider format<a class="anchor" aria-label="anchor" href="#pivotting-to-wider-format"></a>
|
||||
</h2>
|
||||
<div class="sourceCode" id="cb6"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="fu"><a href="../reference/redcap_wider.html">redcap_wider</a></span><span class="op">(</span><span class="va">list</span><span class="op">)</span> <span class="op">|></span> <span class="fu"><a href="https://rdrr.io/r/utils/str.html" class="external-link">str</a></span><span class="op">(</span><span class="op">)</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "label")= chr "Age at event"</span></span>
|
||||
<span><span class="co">#> ..$ event_type : 'labelled' chr [1:13] "TIA" "AIS" "ICH" "ICH" ...</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "label")= chr "Neurovascular event"</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "labels")= Named chr [1:5] "1" "2" "3" "4" ...</span></span>
|
||||
<span><span class="co">#> .. .. ..- attr(*, "names")= chr [1:5] "TIA" "AIS" "ICH" "SAH" ...</span></span>
|
||||
<span><span class="co">#> ..$ new_event_complete : chr [1:13] "Incomplete" "Incomplete" "Incomplete" "Incomplete" ...</span></span></code></pre></div>
|
||||
<p>The <code><a href="../reference/easy_redcap.html">easy_redcap()</a></code> will then (optionally) continue to
|
||||
widen the data, by transforming the list of data.frames to a single
|
||||
data.frame with one row for each subject/record_id (wide data
|
||||
format):</p>
|
||||
<div class="sourceCode" id="cb8"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="va">wide_data</span> <span class="op"><-</span> <span class="fu"><a href="../reference/redcap_wider.html">redcap_wider</a></span><span class="op">(</span><span class="va">list</span><span class="op">)</span> </span>
|
||||
<span><span class="co">#> Joining with `by = join_by(record_id)`</span></span>
|
||||
<span><span class="co">#> Joining with `by = join_by(record_id)`</span></span>
|
||||
<span><span class="co">#> Joining with `by = join_by(record_id)`</span></span>
|
||||
<span><span class="co">#> 'data.frame': 6 obs. of 52 variables:</span></span>
|
||||
<span><span class="co">#> $ record_id : num 1 2 3 4 5 6</span></span>
|
||||
<span><span class="co">#> $ cpr : chr "1203401OB4" "0102342303" "2301569823" "0204051342" ...</span></span>
|
||||
<span><span class="co">#> $ inclusion : Date, format: "2023-03-13" "2023-03-01" ...</span></span>
|
||||
<span><span class="co">#> $ inclusion_time : 'hms' num 12:38:49 10:38:57 12:01:07 20:39:19 ...</span></span>
|
||||
<span><span class="va">wide_data</span> <span class="op">|></span> <span class="fu"><a href="https://rdrr.io/r/utils/str.html" class="external-link">str</a></span><span class="op">(</span><span class="op">)</span></span>
|
||||
<span><span class="co">#> tibble [6 × 49] (S3: tbl_df/tbl/data.frame)</span></span>
|
||||
<span><span class="co">#> $ record_id : num [1:6] 1 2 3 4 5 6</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "ID"</span></span>
|
||||
<span><span class="co">#> $ cpr : chr [1:6] "1203401OB4" "0102342303" "2301569823" "0204051342" ...</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "CPR (Danish civil registration number)"</span></span>
|
||||
<span><span class="co">#> $ inclusion : Date[1:6], format: "2023-03-13" "2023-03-01" ...</span></span>
|
||||
<span><span class="co">#> $ inclusion_time : 'hms' num [1:6] 12:38:49 10:38:57 12:01:07 20:39:19 ...</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "units")= chr "secs"</span></span>
|
||||
<span><span class="co">#> $ dob : Date, format: "1940-03-12" "1934-02-01" ...</span></span>
|
||||
<span><span class="co">#> $ age : num 83 89.1 66.1 117.9 126.2 ...</span></span>
|
||||
<span><span class="co">#> $ age_integer : num 83 89 66 117 126 91</span></span>
|
||||
<span><span class="co">#> $ sex : chr "female" "male" "male" "female" ...</span></span>
|
||||
<span><span class="co">#> $ cohabitation : chr "Yes" "Yes" "No" NA ...</span></span>
|
||||
<span><span class="co">#> $ hypertension : chr "No" "No" "Yes" NA ...</span></span>
|
||||
<span><span class="co">#> $ diabetes : chr "Yes" "No" "Yes" NA ...</span></span>
|
||||
<span><span class="co">#> $ region : chr "East" "South" "North" NA ...</span></span>
|
||||
<span><span class="co">#> $ baseline_data_start_complete: chr "Incomplete" "Incomplete" "Incomplete" "Incomplete" ...</span></span>
|
||||
<span><span class="co">#> $ mrs_assessed_inclusion : chr "Yes" "Yes" NA NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_assessed_follow1 : chr NA "Yes" "Yes" NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_assessed_follow2 : chr NA NA "Yes" NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_date_inclusion : Date, format: "2023-03-13" "2023-03-07" ...</span></span>
|
||||
<span><span class="co">#> $ mrs_date_follow1 : Date, format: NA "2023-03-09" ...</span></span>
|
||||
<span><span class="co">#> $ mrs_date_follow2 : Date, format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_score_inclusion : num 1 1 NA NA NA NA</span></span>
|
||||
<span><span class="co">#> $ mrs_score_follow1 : num NA 3 2 NA NA NA</span></span>
|
||||
<span><span class="co">#> $ mrs_score_follow2 : num NA NA 1 NA NA NA</span></span>
|
||||
<span><span class="co">#> $ mrs_complete_inclusion : chr "Incomplete" "Incomplete" NA NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_complete_follow1 : chr NA "Incomplete" "Incomplete" NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_complete_follow2 : chr NA NA "Incomplete" NA ...</span></span>
|
||||
<span><span class="co">#> $ con_mrs : logi NA NA NA NA NA NA</span></span>
|
||||
<span><span class="co">#> $ con_calc : logi NA NA NA NA NA NA</span></span>
|
||||
<span><span class="co">#> $ consensus_complete : chr NA NA NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_1_follow1 : POSIXct, format: NA "2024-01-18 12:49:42" ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_1_follow2 : POSIXct, format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_age_1_follow1 : num NA NA NA 96 127 NA</span></span>
|
||||
<span><span class="co">#> $ event_age_1_follow2 : num NA NA NA 118 NA NA</span></span>
|
||||
<span><span class="co">#> $ event_type_1_follow1 : chr NA "TIA" "AIS" "TIA" ...</span></span>
|
||||
<span><span class="co">#> $ event_type_1_follow2 : chr NA NA "ICH" "AIS" ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_1_follow1: chr NA "Incomplete" "Incomplete" "Complete" ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_1_follow2: chr NA NA "Incomplete" "Complete" ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_2_follow1 : POSIXct, format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_2_follow2 : POSIXct, format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_3_follow1 : POSIXct, format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_3_follow2 : POSIXct, format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_age_2_follow1 : num NA NA NA 105 127 NA</span></span>
|
||||
<span><span class="co">#> $ event_age_2_follow2 : num NA NA NA 118 NA NA</span></span>
|
||||
<span><span class="co">#> $ event_age_3_follow1 : num NA NA NA NA NA NA</span></span>
|
||||
<span><span class="co">#> $ event_age_3_follow2 : num NA NA NA 118 NA NA</span></span>
|
||||
<span><span class="co">#> $ event_type_2_follow1 : chr NA NA "ICH" "TIA" ...</span></span>
|
||||
<span><span class="co">#> $ event_type_2_follow2 : chr NA NA "TIA" "ICH" ...</span></span>
|
||||
<span><span class="co">#> $ event_type_3_follow1 : chr NA NA NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_type_3_follow2 : chr NA NA "AIS" "Unknown" ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_2_follow1: chr NA NA "Incomplete" "Complete" ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_2_follow2: chr NA NA "Incomplete" "Incomplete" ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_3_follow1: chr NA NA NA NA ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_3_follow2: chr NA NA "Incomplete" "Complete" ...</span></span></code></pre></div>
|
||||
<span><span class="co">#> $ dob : Date[1:6], format: "1940-03-12" "1934-02-01" ...</span></span>
|
||||
<span><span class="co">#> $ age : num [1:6] 83 89.1 66.1 117.9 126.2 ...</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Age\r\nNote: Apparently, the build in datediff() function does not handle counting whole years. This results in"| __truncated__</span></span>
|
||||
<span><span class="co">#> $ age_integer : num [1:6] 83 89 66 117 126 91</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Age integer\r\nNote: as opposed to the build in datediff() this handles counting years as integers very well. C"| __truncated__</span></span>
|
||||
<span><span class="co">#> $ sex : chr [1:6] "female" "male" "male" "female" ...</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Legal sex"</span></span>
|
||||
<span><span class="co">#> $ cohabitation : 'labelled' chr [1:6] "Yes" "Yes" "No" NA ...</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Cohabitation"</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "labels")= Named chr [1:2] "1" "2"</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "names")= chr [1:2] "Yes" "No"</span></span>
|
||||
<span><span class="co">#> $ hypertension : 'labelled' chr [1:6] "No" "No" "Yes" NA ...</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Hypertension"</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "labels")= Named chr [1:2] "1" "2"</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "names")= chr [1:2] "Yes" "No"</span></span>
|
||||
<span><span class="co">#> $ diabetes : 'labelled' chr [1:6] "Yes" "No" "Yes" NA ...</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Diabetes"</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "labels")= Named chr [1:2] "1" "2"</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "names")= chr [1:2] "Yes" "No"</span></span>
|
||||
<span><span class="co">#> $ region : 'labelled' chr [1:6] "East" "South" "North" NA ...</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Region"</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "labels")= Named chr [1:4] "1" "2" "3" "4"</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "names")= chr [1:4] "North" "East" "South" "West"</span></span>
|
||||
<span><span class="co">#> $ baseline_data_start_complete: chr [1:6] "Incomplete" "Incomplete" "Incomplete" "Incomplete" ...</span></span>
|
||||
<span><span class="co">#> $ mrs_assessed_inclusion : 'labelled' chr [1:6] "Yes" "Yes" NA NA ...</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Assesed"</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "labels")= Named chr [1:2] "1" "2"</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "names")= chr [1:2] "Yes" "No"</span></span>
|
||||
<span><span class="co">#> $ mrs_assessed_follow1 : 'labelled' chr [1:6] NA "Yes" "Yes" NA ...</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Assesed"</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "labels")= Named chr [1:2] "1" "2"</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "names")= chr [1:2] "Yes" "No"</span></span>
|
||||
<span><span class="co">#> $ mrs_assessed_follow2 : 'labelled' chr [1:6] NA NA "Yes" NA ...</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Assesed"</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "labels")= Named chr [1:2] "1" "2"</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "names")= chr [1:2] "Yes" "No"</span></span>
|
||||
<span><span class="co">#> $ mrs_date_inclusion : Date[1:6], format: "2023-03-13" "2023-03-07" ...</span></span>
|
||||
<span><span class="co">#> $ mrs_date_follow1 : Date[1:6], format: NA "2023-03-09" ...</span></span>
|
||||
<span><span class="co">#> $ mrs_date_follow2 : Date[1:6], format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_score_inclusion : 'labelled' num [1:6] 1 1 NA NA NA NA</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "mRS score"</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "labels")= Named chr [1:6] "0" "1" "2" "3" ...</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "names")= chr [1:6] "0" "1" "2" "3" ...</span></span>
|
||||
<span><span class="co">#> $ mrs_score_follow1 : 'labelled' num [1:6] NA 3 2 NA NA NA</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "mRS score"</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "labels")= Named chr [1:6] "0" "1" "2" "3" ...</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "names")= chr [1:6] "0" "1" "2" "3" ...</span></span>
|
||||
<span><span class="co">#> $ mrs_score_follow2 : 'labelled' num [1:6] NA NA 1 NA NA NA</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "mRS score"</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "labels")= Named chr [1:6] "0" "1" "2" "3" ...</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "names")= chr [1:6] "0" "1" "2" "3" ...</span></span>
|
||||
<span><span class="co">#> $ mrs_complete_inclusion : chr [1:6] "Incomplete" "Incomplete" NA NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_complete_follow1 : chr [1:6] NA "Incomplete" "Incomplete" NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_complete_follow2 : chr [1:6] NA NA "Incomplete" NA ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_1_follow1 : POSIXct[1:6], format: NA "2024-01-18 12:49:42" ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_1_follow2 : POSIXct[1:6], format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_age_1_follow1 : num [1:6] NA NA NA 96 127 NA</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Age at event"</span></span>
|
||||
<span><span class="co">#> $ event_age_1_follow2 : num [1:6] NA NA NA 118 NA NA</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Age at event"</span></span>
|
||||
<span><span class="co">#> $ event_type_1_follow1 : 'labelled' chr [1:6] NA "TIA" "AIS" "TIA" ...</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Neurovascular event"</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "labels")= Named chr [1:5] "1" "2" "3" "4" ...</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "names")= chr [1:5] "TIA" "AIS" "ICH" "SAH" ...</span></span>
|
||||
<span><span class="co">#> $ event_type_1_follow2 : 'labelled' chr [1:6] NA NA "ICH" "AIS" ...</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Neurovascular event"</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "labels")= Named chr [1:5] "1" "2" "3" "4" ...</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "names")= chr [1:5] "TIA" "AIS" "ICH" "SAH" ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_1_follow1: chr [1:6] NA "Incomplete" "Incomplete" "Complete" ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_1_follow2: chr [1:6] NA NA "Incomplete" "Complete" ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_2_follow1 : POSIXct[1:6], format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_2_follow2 : POSIXct[1:6], format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_3_follow1 : POSIXct[1:6], format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_3_follow2 : POSIXct[1:6], format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_age_2_follow1 : num [1:6] NA NA NA 105 127 NA</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Age at event"</span></span>
|
||||
<span><span class="co">#> $ event_age_2_follow2 : num [1:6] NA NA NA 118 NA NA</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Age at event"</span></span>
|
||||
<span><span class="co">#> $ event_age_3_follow1 : num [1:6] NA NA NA NA NA NA</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Age at event"</span></span>
|
||||
<span><span class="co">#> $ event_age_3_follow2 : num [1:6] NA NA NA 118 NA NA</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Age at event"</span></span>
|
||||
<span><span class="co">#> $ event_type_2_follow1 : 'labelled' chr [1:6] NA NA "ICH" "TIA" ...</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Neurovascular event"</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "labels")= Named chr [1:5] "1" "2" "3" "4" ...</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "names")= chr [1:5] "TIA" "AIS" "ICH" "SAH" ...</span></span>
|
||||
<span><span class="co">#> $ event_type_2_follow2 : 'labelled' chr [1:6] NA NA "TIA" "ICH" ...</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Neurovascular event"</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "labels")= Named chr [1:5] "1" "2" "3" "4" ...</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "names")= chr [1:5] "TIA" "AIS" "ICH" "SAH" ...</span></span>
|
||||
<span><span class="co">#> $ event_type_3_follow1 : 'labelled' chr [1:6] NA NA NA NA ...</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Neurovascular event"</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "labels")= Named chr [1:5] "1" "2" "3" "4" ...</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "names")= chr [1:5] "TIA" "AIS" "ICH" "SAH" ...</span></span>
|
||||
<span><span class="co">#> $ event_type_3_follow2 : 'labelled' chr [1:6] NA NA "AIS" "Unknown" ...</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "label")= chr "Neurovascular event"</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "labels")= Named chr [1:5] "1" "2" "3" "4" ...</span></span>
|
||||
<span><span class="co">#> .. ..- attr(*, "names")= chr [1:5] "TIA" "AIS" "ICH" "SAH" ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_2_follow1: chr [1:6] NA NA "Incomplete" "Complete" ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_2_follow2: chr [1:6] NA NA "Incomplete" "Incomplete" ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_3_follow1: chr [1:6] NA NA NA NA ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_3_follow2: chr [1:6] NA NA "Incomplete" "Complete" ...</span></span></code></pre></div>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="creating-a-nice-table">Creating a nice table<a class="anchor" aria-label="anchor" href="#creating-a-nice-table"></a>
|
||||
</h2>
|
||||
<div class="sourceCode" id="cb9"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="va">wide_data</span> <span class="op">|></span> </span>
|
||||
<span> <span class="fu">dplyr</span><span class="fu">::</span><span class="fu"><a href="https://dplyr.tidyverse.org/reference/select.html" class="external-link">select</a></span><span class="op">(</span><span class="va">sex</span>,<span class="va">hypertension</span>, <span class="va">diabetes</span><span class="op">)</span> <span class="op">|></span> </span>
|
||||
<span> <span class="fu">gtsummary</span><span class="fu">::</span><span class="fu"><a href="https://www.danieldsjoberg.com/gtsummary/reference/tbl_summary.html" class="external-link">tbl_summary</a></span><span class="op">(</span><span class="op">)</span></span></code></pre></div>
|
||||
<div id="ulbfdpbcyv" style="padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;">
|
||||
<style>#ulbfdpbcyv table {
|
||||
font-family: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv thead, #ulbfdpbcyv tbody, #ulbfdpbcyv tfoot, #ulbfdpbcyv tr, #ulbfdpbcyv td, #ulbfdpbcyv th {
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_table {
|
||||
display: table;
|
||||
border-collapse: collapse;
|
||||
line-height: normal;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
color: #333333;
|
||||
font-size: 16px;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
background-color: #FFFFFF;
|
||||
width: auto;
|
||||
border-top-style: solid;
|
||||
border-top-width: 2px;
|
||||
border-top-color: #A8A8A8;
|
||||
border-right-style: none;
|
||||
border-right-width: 2px;
|
||||
border-right-color: #D3D3D3;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-width: 2px;
|
||||
border-bottom-color: #A8A8A8;
|
||||
border-left-style: none;
|
||||
border-left-width: 2px;
|
||||
border-left-color: #D3D3D3;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_caption {
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_title {
|
||||
color: #333333;
|
||||
font-size: 125%;
|
||||
font-weight: initial;
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
border-bottom-color: #FFFFFF;
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_subtitle {
|
||||
color: #333333;
|
||||
font-size: 85%;
|
||||
font-weight: initial;
|
||||
padding-top: 3px;
|
||||
padding-bottom: 5px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
border-top-color: #FFFFFF;
|
||||
border-top-width: 0;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_heading {
|
||||
background-color: #FFFFFF;
|
||||
text-align: center;
|
||||
border-bottom-color: #FFFFFF;
|
||||
border-left-style: none;
|
||||
border-left-width: 1px;
|
||||
border-left-color: #D3D3D3;
|
||||
border-right-style: none;
|
||||
border-right-width: 1px;
|
||||
border-right-color: #D3D3D3;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_bottom_border {
|
||||
border-bottom-style: solid;
|
||||
border-bottom-width: 2px;
|
||||
border-bottom-color: #D3D3D3;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_col_headings {
|
||||
border-top-style: solid;
|
||||
border-top-width: 2px;
|
||||
border-top-color: #D3D3D3;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-width: 2px;
|
||||
border-bottom-color: #D3D3D3;
|
||||
border-left-style: none;
|
||||
border-left-width: 1px;
|
||||
border-left-color: #D3D3D3;
|
||||
border-right-style: none;
|
||||
border-right-width: 1px;
|
||||
border-right-color: #D3D3D3;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_col_heading {
|
||||
color: #333333;
|
||||
background-color: #FFFFFF;
|
||||
font-size: 100%;
|
||||
font-weight: normal;
|
||||
text-transform: inherit;
|
||||
border-left-style: none;
|
||||
border-left-width: 1px;
|
||||
border-left-color: #D3D3D3;
|
||||
border-right-style: none;
|
||||
border-right-width: 1px;
|
||||
border-right-color: #D3D3D3;
|
||||
vertical-align: bottom;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 6px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_column_spanner_outer {
|
||||
color: #333333;
|
||||
background-color: #FFFFFF;
|
||||
font-size: 100%;
|
||||
font-weight: normal;
|
||||
text-transform: inherit;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
padding-left: 4px;
|
||||
padding-right: 4px;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_column_spanner_outer:first-child {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_column_spanner_outer:last-child {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_column_spanner {
|
||||
border-bottom-style: solid;
|
||||
border-bottom-width: 2px;
|
||||
border-bottom-color: #D3D3D3;
|
||||
vertical-align: bottom;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
overflow-x: hidden;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_spanner_row {
|
||||
border-bottom-style: hidden;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_group_heading {
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
color: #333333;
|
||||
background-color: #FFFFFF;
|
||||
font-size: 100%;
|
||||
font-weight: initial;
|
||||
text-transform: inherit;
|
||||
border-top-style: solid;
|
||||
border-top-width: 2px;
|
||||
border-top-color: #D3D3D3;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-width: 2px;
|
||||
border-bottom-color: #D3D3D3;
|
||||
border-left-style: none;
|
||||
border-left-width: 1px;
|
||||
border-left-color: #D3D3D3;
|
||||
border-right-style: none;
|
||||
border-right-width: 1px;
|
||||
border-right-color: #D3D3D3;
|
||||
vertical-align: middle;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_empty_group_heading {
|
||||
padding: 0.5px;
|
||||
color: #333333;
|
||||
background-color: #FFFFFF;
|
||||
font-size: 100%;
|
||||
font-weight: initial;
|
||||
border-top-style: solid;
|
||||
border-top-width: 2px;
|
||||
border-top-color: #D3D3D3;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-width: 2px;
|
||||
border-bottom-color: #D3D3D3;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_from_md > :first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_from_md > :last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_row {
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
margin: 10px;
|
||||
border-top-style: solid;
|
||||
border-top-width: 1px;
|
||||
border-top-color: #D3D3D3;
|
||||
border-left-style: none;
|
||||
border-left-width: 1px;
|
||||
border-left-color: #D3D3D3;
|
||||
border-right-style: none;
|
||||
border-right-width: 1px;
|
||||
border-right-color: #D3D3D3;
|
||||
vertical-align: middle;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_stub {
|
||||
color: #333333;
|
||||
background-color: #FFFFFF;
|
||||
font-size: 100%;
|
||||
font-weight: initial;
|
||||
text-transform: inherit;
|
||||
border-right-style: solid;
|
||||
border-right-width: 2px;
|
||||
border-right-color: #D3D3D3;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_stub_row_group {
|
||||
color: #333333;
|
||||
background-color: #FFFFFF;
|
||||
font-size: 100%;
|
||||
font-weight: initial;
|
||||
text-transform: inherit;
|
||||
border-right-style: solid;
|
||||
border-right-width: 2px;
|
||||
border-right-color: #D3D3D3;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_row_group_first td {
|
||||
border-top-width: 2px;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_row_group_first th {
|
||||
border-top-width: 2px;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_summary_row {
|
||||
color: #333333;
|
||||
background-color: #FFFFFF;
|
||||
text-transform: inherit;
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_first_summary_row {
|
||||
border-top-style: solid;
|
||||
border-top-color: #D3D3D3;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_first_summary_row.thick {
|
||||
border-top-width: 2px;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_last_summary_row {
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-width: 2px;
|
||||
border-bottom-color: #D3D3D3;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_grand_summary_row {
|
||||
color: #333333;
|
||||
background-color: #FFFFFF;
|
||||
text-transform: inherit;
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_first_grand_summary_row {
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
border-top-style: double;
|
||||
border-top-width: 6px;
|
||||
border-top-color: #D3D3D3;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_last_grand_summary_row_top {
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
border-bottom-style: double;
|
||||
border-bottom-width: 6px;
|
||||
border-bottom-color: #D3D3D3;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_striped {
|
||||
background-color: rgba(128, 128, 128, 0.05);
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_table_body {
|
||||
border-top-style: solid;
|
||||
border-top-width: 2px;
|
||||
border-top-color: #D3D3D3;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-width: 2px;
|
||||
border-bottom-color: #D3D3D3;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_footnotes {
|
||||
color: #333333;
|
||||
background-color: #FFFFFF;
|
||||
border-bottom-style: none;
|
||||
border-bottom-width: 2px;
|
||||
border-bottom-color: #D3D3D3;
|
||||
border-left-style: none;
|
||||
border-left-width: 2px;
|
||||
border-left-color: #D3D3D3;
|
||||
border-right-style: none;
|
||||
border-right-width: 2px;
|
||||
border-right-color: #D3D3D3;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_footnote {
|
||||
margin: 0px;
|
||||
font-size: 90%;
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_sourcenotes {
|
||||
color: #333333;
|
||||
background-color: #FFFFFF;
|
||||
border-bottom-style: none;
|
||||
border-bottom-width: 2px;
|
||||
border-bottom-color: #D3D3D3;
|
||||
border-left-style: none;
|
||||
border-left-width: 2px;
|
||||
border-left-color: #D3D3D3;
|
||||
border-right-style: none;
|
||||
border-right-width: 2px;
|
||||
border-right-color: #D3D3D3;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_sourcenote {
|
||||
font-size: 90%;
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_left {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_right {
|
||||
text-align: right;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_font_normal {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_font_bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_font_italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_super {
|
||||
font-size: 65%;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_footnote_marks {
|
||||
font-size: 75%;
|
||||
vertical-align: 0.4em;
|
||||
position: initial;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_asterisk {
|
||||
font-size: 100%;
|
||||
vertical-align: 0;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_indent_1 {
|
||||
text-indent: 5px;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_indent_2 {
|
||||
text-indent: 10px;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_indent_3 {
|
||||
text-indent: 15px;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_indent_4 {
|
||||
text-indent: 20px;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .gt_indent_5 {
|
||||
text-indent: 25px;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv .katex-display {
|
||||
display: inline-flex !important;
|
||||
margin-bottom: 0.75em !important;
|
||||
}
|
||||
|
||||
#ulbfdpbcyv div.Reactable > div.rt-table > div.rt-thead > div.rt-tr.rt-tr-group-header > div.rt-th-group:after {
|
||||
height: 0px !important;
|
||||
}
|
||||
</style>
|
||||
<table class="table gt_table" data-quarto-disable-processing="false" data-quarto-bootstrap="false">
|
||||
<thead><tr class="gt_col_headings">
|
||||
<th class="gt_col_heading gt_columns_bottom_border gt_left" rowspan="1" colspan="1" scope="col" id="label"><span class="gt_from_md"><strong>Characteristic</strong></span></th>
|
||||
<th class="gt_col_heading gt_columns_bottom_border gt_center" rowspan="1" colspan="1" scope="col" id="stat_0">
|
||||
<span class="gt_from_md"><strong>N = 6</strong></span><span class="gt_footnote_marks" style="white-space:nowrap;font-style:italic;font-weight:normal;line-height:0;"><sup>1</sup></span>
|
||||
</th>
|
||||
</tr></thead>
|
||||
<tbody class="gt_table_body">
|
||||
<tr>
|
||||
<td headers="label" class="gt_row gt_left">Legal sex</td>
|
||||
<td headers="stat_0" class="gt_row gt_center"><br></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td headers="label" class="gt_row gt_left"> female</td>
|
||||
<td headers="stat_0" class="gt_row gt_center">3 (50%)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td headers="label" class="gt_row gt_left"> male</td>
|
||||
<td headers="stat_0" class="gt_row gt_center">3 (50%)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td headers="label" class="gt_row gt_left">Hypertension</td>
|
||||
<td headers="stat_0" class="gt_row gt_center"><br></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td headers="label" class="gt_row gt_left"> No</td>
|
||||
<td headers="stat_0" class="gt_row gt_center">2 (40%)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td headers="label" class="gt_row gt_left"> Yes</td>
|
||||
<td headers="stat_0" class="gt_row gt_center">3 (60%)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td headers="label" class="gt_row gt_left"> Unknown</td>
|
||||
<td headers="stat_0" class="gt_row gt_center">1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td headers="label" class="gt_row gt_left">Diabetes</td>
|
||||
<td headers="stat_0" class="gt_row gt_center"><br></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td headers="label" class="gt_row gt_left"> No</td>
|
||||
<td headers="stat_0" class="gt_row gt_center">2 (40%)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td headers="label" class="gt_row gt_left"> Yes</td>
|
||||
<td headers="stat_0" class="gt_row gt_center">3 (60%)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td headers="label" class="gt_row gt_left"> Unknown</td>
|
||||
<td headers="stat_0" class="gt_row gt_center">1</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot class="gt_footnotes"><tr>
|
||||
<td class="gt_footnote" colspan="2">
|
||||
<span class="gt_footnote_marks" style="white-space:nowrap;font-style:italic;font-weight:normal;line-height:0;"><sup>1</sup></span> <span class="gt_from_md">n (%)</span>
|
||||
</td>
|
||||
</tr></tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
|
||||
</nav></aside>
|
||||
|
@ -91,68 +91,65 @@ and launch the app as follows:</p>
|
||||
<span> <span class="fu"><a href="../reference/redcap_wider.html">redcap_wider</a></span><span class="op">(</span><span class="op">)</span> </span>
|
||||
<span><span class="co">#> Joining with `by = join_by(record_id)`</span></span>
|
||||
<span><span class="co">#> Joining with `by = join_by(record_id)`</span></span>
|
||||
<span><span class="co">#> Joining with `by = join_by(record_id)`</span></span>
|
||||
<span><span class="fu"><a href="https://rdrr.io/r/utils/str.html" class="external-link">str</a></span><span class="op">(</span><span class="va">ds</span><span class="op">)</span></span>
|
||||
<span><span class="co">#> 'data.frame': 6 obs. of 52 variables:</span></span>
|
||||
<span><span class="co">#> $ record_id : num 1 2 3 4 5 6</span></span>
|
||||
<span><span class="co">#> $ cpr : chr "1203401OB4" "0102342303" "2301569823" "0204051342" ...</span></span>
|
||||
<span><span class="co">#> $ inclusion : Date, format: "2023-03-13" "2023-03-01" ...</span></span>
|
||||
<span><span class="co">#> $ inclusion_time : 'hms' num 12:38:49 10:38:57 12:01:07 20:39:19 ...</span></span>
|
||||
<span><span class="co">#> tibble [6 × 49] (S3: tbl_df/tbl/data.frame)</span></span>
|
||||
<span><span class="co">#> $ record_id : num [1:6] 1 2 3 4 5 6</span></span>
|
||||
<span><span class="co">#> $ cpr : chr [1:6] "1203401OB4" "0102342303" "2301569823" "0204051342" ...</span></span>
|
||||
<span><span class="co">#> $ inclusion : Date[1:6], format: "2023-03-13" "2023-03-01" ...</span></span>
|
||||
<span><span class="co">#> $ inclusion_time : 'hms' num [1:6] 12:38:49 10:38:57 12:01:07 20:39:19 ...</span></span>
|
||||
<span><span class="co">#> ..- attr(*, "units")= chr "secs"</span></span>
|
||||
<span><span class="co">#> $ dob : Date, format: "1940-03-12" "1934-02-01" ...</span></span>
|
||||
<span><span class="co">#> $ age : num 83 89.1 66.1 117.9 126.2 ...</span></span>
|
||||
<span><span class="co">#> $ age_integer : num 83 89 66 117 126 91</span></span>
|
||||
<span><span class="co">#> $ sex : chr "female" "male" "male" "female" ...</span></span>
|
||||
<span><span class="co">#> $ cohabitation : chr "Yes" "Yes" "No" NA ...</span></span>
|
||||
<span><span class="co">#> $ hypertension : chr "No" "No" "Yes" NA ...</span></span>
|
||||
<span><span class="co">#> $ diabetes : chr "Yes" "No" "Yes" NA ...</span></span>
|
||||
<span><span class="co">#> $ region : chr "East" "South" "North" NA ...</span></span>
|
||||
<span><span class="co">#> $ baseline_data_start_complete: chr "Incomplete" "Incomplete" "Incomplete" "Incomplete" ...</span></span>
|
||||
<span><span class="co">#> $ mrs_assessed_inclusion : chr "Yes" "Yes" NA NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_assessed_follow1 : chr NA "Yes" "Yes" NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_assessed_follow2 : chr NA NA "Yes" NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_date_inclusion : Date, format: "2023-03-13" "2023-03-07" ...</span></span>
|
||||
<span><span class="co">#> $ mrs_date_follow1 : Date, format: NA "2023-03-09" ...</span></span>
|
||||
<span><span class="co">#> $ mrs_date_follow2 : Date, format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_score_inclusion : num 1 1 NA NA NA NA</span></span>
|
||||
<span><span class="co">#> $ mrs_score_follow1 : num NA 3 2 NA NA NA</span></span>
|
||||
<span><span class="co">#> $ mrs_score_follow2 : num NA NA 1 NA NA NA</span></span>
|
||||
<span><span class="co">#> $ mrs_complete_inclusion : chr "Incomplete" "Incomplete" NA NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_complete_follow1 : chr NA "Incomplete" "Incomplete" NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_complete_follow2 : chr NA NA "Incomplete" NA ...</span></span>
|
||||
<span><span class="co">#> $ con_mrs : logi NA NA NA NA NA NA</span></span>
|
||||
<span><span class="co">#> $ con_calc : logi NA NA NA NA NA NA</span></span>
|
||||
<span><span class="co">#> $ consensus_complete : chr NA NA NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_1_follow1 : POSIXct, format: NA "2024-01-18 12:49:42" ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_1_follow2 : POSIXct, format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_age_1_follow1 : num NA NA NA 96 127 NA</span></span>
|
||||
<span><span class="co">#> $ event_age_1_follow2 : num NA NA NA 118 NA NA</span></span>
|
||||
<span><span class="co">#> $ event_type_1_follow1 : chr NA "TIA" "AIS" "TIA" ...</span></span>
|
||||
<span><span class="co">#> $ event_type_1_follow2 : chr NA NA "ICH" "AIS" ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_1_follow1: chr NA "Incomplete" "Incomplete" "Complete" ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_1_follow2: chr NA NA "Incomplete" "Complete" ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_2_follow1 : POSIXct, format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_2_follow2 : POSIXct, format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_3_follow1 : POSIXct, format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_3_follow2 : POSIXct, format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_age_2_follow1 : num NA NA NA 105 127 NA</span></span>
|
||||
<span><span class="co">#> $ event_age_2_follow2 : num NA NA NA 118 NA NA</span></span>
|
||||
<span><span class="co">#> $ event_age_3_follow1 : num NA NA NA NA NA NA</span></span>
|
||||
<span><span class="co">#> $ event_age_3_follow2 : num NA NA NA 118 NA NA</span></span>
|
||||
<span><span class="co">#> $ event_type_2_follow1 : chr NA NA "ICH" "TIA" ...</span></span>
|
||||
<span><span class="co">#> $ event_type_2_follow2 : chr NA NA "TIA" "ICH" ...</span></span>
|
||||
<span><span class="co">#> $ event_type_3_follow1 : chr NA NA NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_type_3_follow2 : chr NA NA "AIS" "Unknown" ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_2_follow1: chr NA NA "Incomplete" "Complete" ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_2_follow2: chr NA NA "Incomplete" "Incomplete" ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_3_follow1: chr NA NA NA NA ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_3_follow2: chr NA NA "Incomplete" "Complete" ...</span></span></code></pre></div>
|
||||
<span><span class="co">#> $ dob : Date[1:6], format: "1940-03-12" "1934-02-01" ...</span></span>
|
||||
<span><span class="co">#> $ age : num [1:6] 83 89.1 66.1 117.9 126.2 ...</span></span>
|
||||
<span><span class="co">#> $ age_integer : num [1:6] 83 89 66 117 126 91</span></span>
|
||||
<span><span class="co">#> $ sex : chr [1:6] "female" "male" "male" "female" ...</span></span>
|
||||
<span><span class="co">#> $ cohabitation : chr [1:6] "Yes" "Yes" "No" NA ...</span></span>
|
||||
<span><span class="co">#> $ hypertension : chr [1:6] "No" "No" "Yes" NA ...</span></span>
|
||||
<span><span class="co">#> $ diabetes : chr [1:6] "Yes" "No" "Yes" NA ...</span></span>
|
||||
<span><span class="co">#> $ region : chr [1:6] "East" "South" "North" NA ...</span></span>
|
||||
<span><span class="co">#> $ baseline_data_start_complete: chr [1:6] "Incomplete" "Incomplete" "Incomplete" "Incomplete" ...</span></span>
|
||||
<span><span class="co">#> $ mrs_assessed_inclusion : chr [1:6] "Yes" "Yes" NA NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_assessed_follow1 : chr [1:6] NA "Yes" "Yes" NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_assessed_follow2 : chr [1:6] NA NA "Yes" NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_date_inclusion : Date[1:6], format: "2023-03-13" "2023-03-07" ...</span></span>
|
||||
<span><span class="co">#> $ mrs_date_follow1 : Date[1:6], format: NA "2023-03-09" ...</span></span>
|
||||
<span><span class="co">#> $ mrs_date_follow2 : Date[1:6], format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_score_inclusion : num [1:6] 1 1 NA NA NA NA</span></span>
|
||||
<span><span class="co">#> $ mrs_score_follow1 : num [1:6] NA 3 2 NA NA NA</span></span>
|
||||
<span><span class="co">#> $ mrs_score_follow2 : num [1:6] NA NA 1 NA NA NA</span></span>
|
||||
<span><span class="co">#> $ mrs_complete_inclusion : chr [1:6] "Incomplete" "Incomplete" NA NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_complete_follow1 : chr [1:6] NA "Incomplete" "Incomplete" NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_complete_follow2 : chr [1:6] NA NA "Incomplete" NA ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_1_follow1 : POSIXct[1:6], format: NA "2024-01-18 12:49:42" ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_1_follow2 : POSIXct[1:6], format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_age_1_follow1 : num [1:6] NA NA NA 96 127 NA</span></span>
|
||||
<span><span class="co">#> $ event_age_1_follow2 : num [1:6] NA NA NA 118 NA NA</span></span>
|
||||
<span><span class="co">#> $ event_type_1_follow1 : chr [1:6] NA "TIA" "AIS" "TIA" ...</span></span>
|
||||
<span><span class="co">#> $ event_type_1_follow2 : chr [1:6] NA NA "ICH" "AIS" ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_1_follow1: chr [1:6] NA "Incomplete" "Incomplete" "Complete" ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_1_follow2: chr [1:6] NA NA "Incomplete" "Complete" ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_2_follow1 : POSIXct[1:6], format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_2_follow2 : POSIXct[1:6], format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_3_follow1 : POSIXct[1:6], format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_3_follow2 : POSIXct[1:6], format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_age_2_follow1 : num [1:6] NA NA NA 105 127 NA</span></span>
|
||||
<span><span class="co">#> $ event_age_2_follow2 : num [1:6] NA NA NA 118 NA NA</span></span>
|
||||
<span><span class="co">#> $ event_age_3_follow1 : num [1:6] NA NA NA NA NA NA</span></span>
|
||||
<span><span class="co">#> $ event_age_3_follow2 : num [1:6] NA NA NA 118 NA NA</span></span>
|
||||
<span><span class="co">#> $ event_type_2_follow1 : chr [1:6] NA NA "ICH" "TIA" ...</span></span>
|
||||
<span><span class="co">#> $ event_type_2_follow2 : chr [1:6] NA NA "TIA" "ICH" ...</span></span>
|
||||
<span><span class="co">#> $ event_type_3_follow1 : chr [1:6] NA NA NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_type_3_follow2 : chr [1:6] NA NA "AIS" "Unknown" ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_2_follow1: chr [1:6] NA NA "Incomplete" "Complete" ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_2_follow2: chr [1:6] NA NA "Incomplete" "Incomplete" ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_3_follow1: chr [1:6] NA NA NA NA ...</span></span>
|
||||
<span><span class="co">#> $ new_event_complete_3_follow2: chr [1:6] NA NA "Incomplete" "Complete" ...</span></span>
|
||||
<span><span class="co">#> - attr(*, "problems")=<externalptr></span></span></code></pre></div>
|
||||
<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="va">ds</span><span class="op">|></span> </span>
|
||||
<span> <span class="fu"><a href="../reference/ds2dd_detailed.html">ds2dd_detailed</a></span><span class="op">(</span>metadata <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/names.html" class="external-link">names</a></span><span class="op">(</span><span class="fu">REDCapCAST</span><span class="fu">::</span><span class="va"><a href="../reference/redcapcast_meta.html">redcapcast_meta</a></span><span class="op">)</span><span class="op">)</span><span class="op">|></span> </span>
|
||||
<span> <span class="fu">purrr</span><span class="fu">::</span><span class="fu"><a href="https://purrr.tidyverse.org/reference/pluck.html" class="external-link">pluck</a></span><span class="op">(</span><span class="st">"data"</span><span class="op">)</span> <span class="op">|></span> </span>
|
||||
<span> <span class="fu"><a href="https://rdrr.io/r/utils/str.html" class="external-link">str</a></span><span class="op">(</span><span class="op">)</span></span>
|
||||
<span><span class="co">#> tibble [6 × 52] (S3: tbl_df/tbl/data.frame)</span></span>
|
||||
<span><span class="co">#> tibble [6 × 49] (S3: tbl_df/tbl/data.frame)</span></span>
|
||||
<span><span class="co">#> $ record_id : num [1:6] 1 2 3 4 5 6</span></span>
|
||||
<span><span class="co">#> $ cpr : chr [1:6] "1203401OB4" "0102342303" "2301569823" "0204051342" ...</span></span>
|
||||
<span><span class="co">#> $ inclusion : Date[1:6], format: "2023-03-13" "2023-03-01" ...</span></span>
|
||||
@ -178,9 +175,6 @@ and launch the app as follows:</p>
|
||||
<span><span class="co">#> $ mrs_complete_inclusion : chr [1:6] "Incomplete" "Incomplete" NA NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_complete_follow1 : chr [1:6] NA "Incomplete" "Incomplete" NA ...</span></span>
|
||||
<span><span class="co">#> $ mrs_complete_follow2 : chr [1:6] NA NA "Incomplete" NA ...</span></span>
|
||||
<span><span class="co">#> $ con_mrs : Factor w/ 2 levels "FALSE","TRUE": NA NA NA NA NA NA</span></span>
|
||||
<span><span class="co">#> $ con_calc : Factor w/ 2 levels "FALSE","TRUE": NA NA NA NA NA NA</span></span>
|
||||
<span><span class="co">#> $ consensus_complete : chr [1:6] NA NA NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_1_follow1 : POSIXct[1:6], format: NA "2024-01-18 12:49:42" ...</span></span>
|
||||
<span><span class="co">#> $ event_datetime_1_follow2 : POSIXct[1:6], format: NA NA ...</span></span>
|
||||
<span><span class="co">#> $ event_age_1_follow1 : num [1:6] NA NA NA 96 127 NA</span></span>
|
||||
@ -223,7 +217,7 @@ and launch the app as follows:</p>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 8</span> sex data <span style="color: #BB0000;">NA</span> text sex </span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;"> 9</span> cohabitation data <span style="color: #BB0000;">NA</span> text cohabitation </span></span>
|
||||
<span><span class="co">#> <span style="color: #BCBCBC;">10</span> hypertension data <span style="color: #BB0000;">NA</span> text hypertension </span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># ℹ 13 more variables: select_choices_or_calculations <chr>, field_note <lgl>,</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># ℹ 13 more variables: select_choices_or_calculations <lgl>, field_note <lgl>,</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># text_validation_type_or_show_slider_number <chr>,</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># text_validation_min <lgl>, text_validation_max <lgl>, identifier <lgl>,</span></span></span>
|
||||
<span><span class="co">#> <span style="color: #949494;"># branching_logic <lgl>, required_field <lgl>, custom_alignment <lgl>,</span></span></span>
|
||||
|
@ -5,7 +5,7 @@ articles:
|
||||
Database-creation: Database-creation.html
|
||||
REDCapCAST: REDCapCAST.html
|
||||
Shiny-app: Shiny-app.html
|
||||
last_built: 2024-11-27T15:00Z
|
||||
last_built: 2024-11-28T13:43Z
|
||||
urls:
|
||||
reference: https://agdamsbo.github.io/REDCapCAST/reference
|
||||
article: https://agdamsbo.github.io/REDCapCAST/articles
|
||||
|
@ -76,8 +76,7 @@ JSON from an API call.</p></dd>
|
||||
|
||||
<dt id="arg-primary-table-name">primary_table_name<a class="anchor" aria-label="anchor" href="#arg-primary-table-name"></a></dt>
|
||||
<dd><p>Name given to the list element for the primary
|
||||
output table (as described in <em>README.md</em>). Ignored if
|
||||
<code>forms = 'all'</code>.</p></dd>
|
||||
output table. Ignored if <code>forms = 'all'</code>.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-forms">forms<a class="anchor" aria-label="anchor" href="#arg-forms"></a></dt>
|
||||
@ -95,7 +94,7 @@ instruments only or for all forms.</p></dd>
|
||||
</ul></div>
|
||||
<div class="section level2">
|
||||
<h2 id="author">Author<a class="anchor" aria-label="anchor" href="#author"></a></h2>
|
||||
<p>Paul W. Egeler, M.S., GStat</p>
|
||||
<p>Paul W. Egeler</p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
@ -123,7 +122,7 @@ instruments only or for all forms.</p></dd>
|
||||
<span class="r-in"><span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># Convert exported JSON strings into a list of data.frames</span></span></span>
|
||||
<span class="r-in"><span><span class="fu">REDCapRITS</span><span class="fu">::</span><span class="fu">REDCap_split</span><span class="op">(</span><span class="va">records</span>, <span class="va">metadata</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="fu">REDCapCAST</span><span class="fu">::</span><span class="fu">REDCap_split</span><span class="op">(</span><span class="va">records</span>, <span class="va">metadata</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># Using a raw data export -------------------------------------------------</span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
@ -136,7 +135,7 @@ instruments only or for all forms.</p></dd>
|
||||
<span class="r-in"><span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># Split the tables</span></span></span>
|
||||
<span class="r-in"><span><span class="fu">REDCapRITS</span><span class="fu">::</span><span class="fu">REDCap_split</span><span class="op">(</span><span class="va">records</span>, <span class="va">metadata</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="fu">REDCapCAST</span><span class="fu">::</span><span class="fu">REDCap_split</span><span class="op">(</span><span class="va">records</span>, <span class="va">metadata</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># In conjunction with the R export script ---------------------------------</span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
@ -153,7 +152,7 @@ instruments only or for all forms.</p></dd>
|
||||
<span class="r-in"><span><span class="va">metadata</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/utils/read.table.html" class="external-link">read.csv</a></span><span class="op">(</span><span class="st">"ExampleProject_DataDictionary_2018-06-03.csv"</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># Split the tables</span></span></span>
|
||||
<span class="r-in"><span><span class="fu">REDCapRITS</span><span class="fu">::</span><span class="fu">REDCap_split</span><span class="op">(</span><span class="va">data</span>, <span class="va">metadata</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="fu">REDCapCAST</span><span class="fu">::</span><span class="fu">REDCap_split</span><span class="op">(</span><span class="va">data</span>, <span class="va">metadata</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/getwd.html" class="external-link">setwd</a></span><span class="op">(</span><span class="va">old</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="op">}</span> <span class="co"># }</span></span></span>
|
||||
</code></pre></div>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Convert labelled vectors to factors while preserving attributes — as_factor • REDCapCAST</title><!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png"><link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png"><link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png"><link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="../deps/font-awesome-6.5.2/css/all.min.css" rel="stylesheet"><link href="../deps/font-awesome-6.5.2/css/v4-shims.min.css" rel="stylesheet"><script src="../deps/headroom-0.11.0/headroom.min.js"></script><script src="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="../deps/search-1.0.0/fuse.min.js"></script><script src="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Convert labelled vectors to factors while preserving attributes — as_factor"><meta name="description" content='This extends [forcats::as_factor()] as well as [haven::as_factor()], by appending
|
||||
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Convert labelled vectors to factors while preserving attributes — as_factor • REDCapCAST</title><!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png"><link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png"><link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png"><link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="../deps/font-awesome-6.5.2/css/all.min.css" rel="stylesheet"><link href="../deps/font-awesome-6.5.2/css/v4-shims.min.css" rel="stylesheet"><script src="../deps/headroom-0.11.0/headroom.min.js"></script><script src="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="../deps/search-1.0.0/fuse.min.js"></script><script src="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Convert labelled vectors to factors while preserving attributes — as_factor"><meta name="description" content='This extends as_factor as well as as_factor, by appending
|
||||
original attributes except for "class" after converting to factor to avoid
|
||||
ta loss in case of rich formatted and labelled data.'><meta property="og:description" content='This extends [forcats::as_factor()] as well as [haven::as_factor()], by appending
|
||||
ta loss in case of rich formatted and labelled data.'><meta property="og:description" content='This extends as_factor as well as as_factor, by appending
|
||||
original attributes except for "class" after converting to factor to avoid
|
||||
ta loss in case of rich formatted and labelled data.'><meta property="og:image" content="https://agdamsbo.github.io/REDCapCAST/logo.png"></head><body>
|
||||
<a href="#main" class="visually-hidden-focusable">Skip to contents</a>
|
||||
@ -43,7 +43,7 @@ ta loss in case of rich formatted and labelled data.'><meta property="og:image"
|
||||
</div>
|
||||
|
||||
<div class="ref-description section level2">
|
||||
<p>This extends [forcats::as_factor()] as well as [haven::as_factor()], by appending
|
||||
<p>This extends <a href="https://forcats.tidyverse.org/reference/as_factor.html" class="external-link">as_factor</a> as well as <a href="https://forcats.tidyverse.org/reference/as_factor.html" class="external-link">as_factor</a>, by appending
|
||||
original attributes except for "class" after converting to factor to avoid
|
||||
ta loss in case of rich formatted and labelled data.</p>
|
||||
</div>
|
||||
@ -80,14 +80,6 @@ ta loss in case of rich formatted and labelled data.</p>
|
||||
<span> <span class="va">...</span></span>
|
||||
<span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
<span><span class="co"># S3 method for class 'redcapcast_labelled'</span></span>
|
||||
<span><span class="fu">as_factor</span><span class="op">(</span></span>
|
||||
<span> <span class="va">x</span>,</span>
|
||||
<span> levels <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"default"</span>, <span class="st">"labels"</span>, <span class="st">"values"</span>, <span class="st">"both"</span><span class="op">)</span>,</span>
|
||||
<span> ordered <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||
<span> <span class="va">...</span></span>
|
||||
<span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
<span><span class="co"># S3 method for class 'data.frame'</span></span>
|
||||
<span><span class="fu">as_factor</span><span class="op">(</span><span class="va">x</span>, <span class="va">...</span>, only_labelled <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></code></pre></div>
|
||||
</div>
|
||||
|
@ -53,7 +53,7 @@
|
||||
|
||||
<dl><dt id="arg-project-name">project.name<a class="anchor" aria-label="anchor" href="#arg-project-name"></a></dt>
|
||||
<dd><p>The name of the current project (for key storage with
|
||||
`keyring::key_set()`, using the default keyring)</p></dd>
|
||||
<a href="https://keyring.r-lib.org/reference/key_get.html" class="external-link">key_set</a>, using the default keyring)</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-widen-data">widen.data<a class="anchor" aria-label="anchor" href="#arg-widen-data"></a></dt>
|
||||
@ -65,7 +65,7 @@
|
||||
|
||||
|
||||
<dt id="arg--">...<a class="anchor" aria-label="anchor" href="#arg--"></a></dt>
|
||||
<dd><p>arguments passed on to `REDCapCAST::read_redcap_tables()`</p></dd>
|
||||
<dd><p>arguments passed on to <a href="read_redcap_tables.html">read_redcap_tables</a>.</p></dd>
|
||||
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
@ -73,6 +73,13 @@
|
||||
<p>data.frame or list depending on widen.data</p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="cn">FALSE</span><span class="op">)</span> <span class="op">{</span> <span class="co"># \dontrun{</span></span></span>
|
||||
<span class="r-in"><span><span class="fu">easy_redcap</span><span class="op">(</span><span class="st">"My_new_project"</span>,fields<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"record_id"</span>,<span class="st">"age"</span>,<span class="st">"hypertension"</span><span class="op">)</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="op">}</span> <span class="co"># }</span></span></span>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
|
||||
</nav></aside></div>
|
||||
|
||||
|
@ -83,23 +83,12 @@
|
||||
<span class="r-in"><span> <span class="fu">fct2num</span><span class="op">(</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 1 2 3 2 10 9</span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="co"># Outlier with labels, but no class of origin, handled like numeric vector</span></span></span>
|
||||
<span class="r-in"><span><span class="co"># structure(c(1, 2, 3, 2, 10, 9),</span></span></span>
|
||||
<span class="r-in"><span><span class="co"># labels = c(Unknown = 9, Refused = 10)</span></span></span>
|
||||
<span class="r-in"><span><span class="co"># ) |></span></span></span>
|
||||
<span class="r-in"><span><span class="co"># as_factor() |></span></span></span>
|
||||
<span class="r-in"><span><span class="co"># fct2num()</span></span></span>
|
||||
<span class="r-in"><span></span></span>
|
||||
<span class="r-in"><span><span class="va">v</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/sample.html" class="external-link">sample</a></span><span class="op">(</span><span class="fl">6</span><span class="op">:</span><span class="fl">19</span>, <span class="fl">20</span>, <span class="cn">TRUE</span><span class="op">)</span> <span class="op">|></span> <span class="fu"><a href="https://rdrr.io/r/base/factor.html" class="external-link">factor</a></span><span class="op">(</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/dput.html" class="external-link">dput</a></span><span class="op">(</span><span class="va">v</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> structure(c(7L, 1L, 10L, 3L, 10L, 10L, 9L, 8L, 3L, 2L, 6L, 8L, </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 3L, 5L, 4L, 8L, 1L, 6L, 5L, 5L), levels = c("6", "7", "8", "9", </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> "11", "12", "13", "15", "16", "17"), class = "factor")</span>
|
||||
<span class="r-in"><span><span class="fu"><a href="named_levels.html">named_levels</a></span><span class="op">(</span><span class="va">v</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 13 6 17 8 16 15 7 12 11 9 </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 7 1 10 3 9 8 2 6 5 4 </span>
|
||||
<span class="r-in"><span><span class="fu">fct2num</span><span class="op">(</span><span class="va">v</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 13 6 17 8 17 17 16 15 8 7 12 15 8 11 9 15 6 12 11 11</span>
|
||||
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/structure.html" class="external-link">structure</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">1</span>, <span class="fl">2</span>, <span class="fl">3</span>, <span class="fl">2</span>, <span class="fl">10</span>, <span class="fl">9</span><span class="op">)</span>,</span></span>
|
||||
<span class="r-in"><span> labels <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span>Unknown <span class="op">=</span> <span class="fl">9</span>, Refused <span class="op">=</span> <span class="fl">10</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="op">)</span> <span class="op">|></span></span></span>
|
||||
<span class="r-in"><span> <span class="fu"><a href="as_factor.html">as_factor</a></span><span class="op">(</span><span class="op">)</span> <span class="op">|></span></span></span>
|
||||
<span class="r-in"><span> <span class="fu">fct2num</span><span class="op">(</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 1 2 3 2 NA NA</span>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
|
||||
|
100
reference/format_redcap_factor.html
Normal file
100
reference/format_redcap_factor.html
Normal file
@ -0,0 +1,100 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Converts REDCap choices to factor levels and stores in labels attribute — format_redcap_factor • REDCapCAST</title><!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png"><link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png"><link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png"><link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="../deps/font-awesome-6.5.2/css/all.min.css" rel="stylesheet"><link href="../deps/font-awesome-6.5.2/css/v4-shims.min.css" rel="stylesheet"><script src="../deps/headroom-0.11.0/headroom.min.js"></script><script src="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="../deps/search-1.0.0/fuse.min.js"></script><script src="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Converts REDCap choices to factor levels and stores in labels attribute — format_redcap_factor"><meta name="description" content="Applying as_factor to the data.frame or variable, will
|
||||
coerce to a factor."><meta property="og:description" content="Applying as_factor to the data.frame or variable, will
|
||||
coerce to a factor."><meta property="og:image" content="https://agdamsbo.github.io/REDCapCAST/logo.png"></head><body>
|
||||
<a href="#main" class="visually-hidden-focusable">Skip to contents</a>
|
||||
|
||||
|
||||
<nav class="navbar navbar-expand-lg fixed-top bg-light" data-bs-theme="light" aria-label="Site navigation"><div class="container">
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">REDCapCAST</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">24.11.4</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div id="navbar" class="collapse navbar-collapse ms-3">
|
||||
<ul class="navbar-nav me-auto"><li class="nav-item"><a class="nav-link" href="../articles/REDCapCAST.html">Get started</a></li>
|
||||
<li class="active nav-item"><a class="nav-link" href="../reference/index.html">Reference</a></li>
|
||||
<li class="nav-item dropdown">
|
||||
<button class="nav-link dropdown-toggle" type="button" id="dropdown-articles" data-bs-toggle="dropdown" aria-expanded="false" aria-haspopup="true">Articles</button>
|
||||
<ul class="dropdown-menu" aria-labelledby="dropdown-articles"><li><a class="dropdown-item" href="../articles/Database-creation.html">Database-creation</a></li>
|
||||
<li><a class="dropdown-item" href="../articles/Shiny-app.html">Shiny-app</a></li>
|
||||
</ul></li>
|
||||
<li class="nav-item"><a class="nav-link" href="../news/index.html">Changelog</a></li>
|
||||
</ul><ul class="navbar-nav"><li class="nav-item"><form class="form-inline" role="search">
|
||||
<input class="form-control" type="search" name="search-input" id="search-input" autocomplete="off" aria-label="Search site" placeholder="Search for" data-search-index="../search.json"></form></li>
|
||||
<li class="nav-item"><a class="external-link nav-link" href="https://github.com/agdamsbo/REDCapCAST/" aria-label="GitHub"><span class="fa fab fa-github fa-lg"></span></a></li>
|
||||
</ul></div>
|
||||
|
||||
|
||||
</div>
|
||||
</nav><div class="container template-reference-topic">
|
||||
<div class="row">
|
||||
<main id="main" class="col-md-9"><div class="page-header">
|
||||
<img src="../logo.png" class="logo" alt=""><h1>Converts REDCap choices to factor levels and stores in labels attribute</h1>
|
||||
<small class="dont-index">Source: <a href="https://github.com/agdamsbo/REDCapCAST/blob/main/R/read_redcap_tables.R" class="external-link"><code>R/read_redcap_tables.R</code></a></small>
|
||||
<div class="d-none name"><code>format_redcap_factor.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description section level2">
|
||||
<p>Applying <a href="as_factor.html">as_factor</a> to the data.frame or variable, will
|
||||
coerce to a factor.</p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="ref-usage">Usage<a class="anchor" aria-label="anchor" href="#ref-usage"></a></h2>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">format_redcap_factor</span><span class="op">(</span><span class="va">data</span>, <span class="va">meta</span><span class="op">)</span></span></code></pre></div>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#arguments"></a></h2>
|
||||
|
||||
|
||||
<dl><dt id="arg-data">data<a class="anchor" aria-label="anchor" href="#arg-data"></a></dt>
|
||||
<dd><p>vector</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-meta">meta<a class="anchor" aria-label="anchor" href="#arg-meta"></a></dt>
|
||||
<dd><p>vector of REDCap choices</p></dd>
|
||||
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
|
||||
<p>vector of class "labelled" with a "labels" attribute</p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="fu">format_redcap_factor</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/sample.html" class="external-link">sample</a></span><span class="op">(</span><span class="fl">1</span><span class="op">:</span><span class="fl">3</span>,<span class="fl">20</span>,<span class="cn">TRUE</span><span class="op">)</span>,<span class="st">"1, First. | 2, second | 3, THIRD"</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] 1 3 3 2 3 2 3 2 3 2 2 1 3 2 2 3 1 2 1 1</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> attr(,"labels")</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> First. second THIRD </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> "1" "2" "3" </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> attr(,"class")</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] "labelled"</span>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
|
||||
</nav></aside></div>
|
||||
|
||||
|
||||
<footer><div class="pkgdown-footer-left">
|
||||
<p>Developed by Andreas Gammelgaard Damsbo, Paul Egeler.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown-footer-right">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.1.1.</p>
|
||||
</div>
|
||||
|
||||
</footer></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body></html>
|
||||
|
@ -1,5 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Retrieve project API key if stored, if not, set and retrieve — get_api_key • REDCapCAST</title><!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png"><link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png"><link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png"><link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="../deps/font-awesome-6.5.2/css/all.min.css" rel="stylesheet"><link href="../deps/font-awesome-6.5.2/css/v4-shims.min.css" rel="stylesheet"><script src="../deps/headroom-0.11.0/headroom.min.js"></script><script src="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="../deps/search-1.0.0/fuse.min.js"></script><script src="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Retrieve project API key if stored, if not, set and retrieve — get_api_key"><meta name="description" content="Retrieve project API key if stored, if not, set and retrieve"><meta property="og:description" content="Retrieve project API key if stored, if not, set and retrieve"><meta property="og:image" content="https://agdamsbo.github.io/REDCapCAST/logo.png"></head><body>
|
||||
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Retrieve project API key if stored, if not, set and retrieve — get_api_key • REDCapCAST</title><!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png"><link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png"><link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png"><link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="../deps/font-awesome-6.5.2/css/all.min.css" rel="stylesheet"><link href="../deps/font-awesome-6.5.2/css/v4-shims.min.css" rel="stylesheet"><script src="../deps/headroom-0.11.0/headroom.min.js"></script><script src="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="../deps/search-1.0.0/fuse.min.js"></script><script src="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Retrieve project API key if stored, if not, set and retrieve — get_api_key"><meta name="description" content="Attempting to make secure API key storage so simple, that no other way makes
|
||||
sense. Wrapping key_get and key_set using the
|
||||
key_list to check if key is in storage already."><meta property="og:description" content="Attempting to make secure API key storage so simple, that no other way makes
|
||||
sense. Wrapping key_get and key_set using the
|
||||
key_list to check if key is in storage already."><meta property="og:image" content="https://agdamsbo.github.io/REDCapCAST/logo.png"></head><body>
|
||||
<a href="#main" class="visually-hidden-focusable">Skip to contents</a>
|
||||
|
||||
|
||||
@ -39,12 +43,14 @@
|
||||
</div>
|
||||
|
||||
<div class="ref-description section level2">
|
||||
<p>Retrieve project API key if stored, if not, set and retrieve</p>
|
||||
<p>Attempting to make secure API key storage so simple, that no other way makes
|
||||
sense. Wrapping <a href="https://keyring.r-lib.org/reference/key_get.html" class="external-link">key_get</a> and <a href="https://keyring.r-lib.org/reference/key_get.html" class="external-link">key_set</a> using the
|
||||
<a href="https://keyring.r-lib.org/reference/key_get.html" class="external-link">key_list</a> to check if key is in storage already.</p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="ref-usage">Usage<a class="anchor" aria-label="anchor" href="#ref-usage"></a></h2>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">get_api_key</span><span class="op">(</span><span class="va">key.name</span><span class="op">)</span></span></code></pre></div>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">get_api_key</span><span class="op">(</span><span class="va">key.name</span>, <span class="va">...</span><span class="op">)</span></span></code></pre></div>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
@ -54,6 +60,10 @@
|
||||
<dl><dt id="arg-key-name">key.name<a class="anchor" aria-label="anchor" href="#arg-key-name"></a></dt>
|
||||
<dd><p>character vector of key name</p></dd>
|
||||
|
||||
|
||||
<dt id="arg--">...<a class="anchor" aria-label="anchor" href="#arg--"></a></dt>
|
||||
<dd><p>passed to <a href="https://keyring.r-lib.org/reference/key_get.html" class="external-link">key_set</a></p></dd>
|
||||
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
|
||||
|
@ -199,6 +199,12 @@
|
||||
<dd>focused_metadata</dd>
|
||||
</dl><dl><dt>
|
||||
|
||||
<code><a href="format_redcap_factor.html">format_redcap_factor()</a></code>
|
||||
|
||||
</dt>
|
||||
<dd>Converts REDCap choices to factor levels and stores in labels attribute</dd>
|
||||
</dl><dl><dt>
|
||||
|
||||
<code><a href="format_subheader.html">format_subheader()</a></code>
|
||||
|
||||
</dt>
|
||||
@ -313,6 +319,12 @@
|
||||
<dd>Helper to auto-parse un-formatted data with haven and readr</dd>
|
||||
</dl><dl><dt>
|
||||
|
||||
<code><a href="possibly_numeric.html">possibly_numeric()</a></code>
|
||||
|
||||
</dt>
|
||||
<dd>Tests if vector can be interpreted as numeric without introducing NAs by coercion</dd>
|
||||
</dl><dl><dt>
|
||||
|
||||
<code><a href="possibly_roman.html">possibly_roman()</a></code>
|
||||
|
||||
</dt>
|
||||
@ -370,7 +382,7 @@
|
||||
<code><a href="redcap_wider.html">redcap_wider()</a></code>
|
||||
|
||||
</dt>
|
||||
<dd>Redcap Wider</dd>
|
||||
<dd>Transforms list of REDCap data.frames to a single wide data.frame</dd>
|
||||
</dl><dl><dt>
|
||||
|
||||
<code><a href="redcapcast_data.html">redcapcast_data</a></code>
|
||||
|
@ -44,10 +44,7 @@
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="ref-usage">Usage<a class="anchor" aria-label="anchor" href="#ref-usage"></a></h2>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">is.labelled</span><span class="op">(</span></span>
|
||||
<span> <span class="va">x</span>,</span>
|
||||
<span> classes <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"redcapcast_labelled"</span>, <span class="st">"haven_labelled"</span>, <span class="st">"labelled"</span><span class="op">)</span></span>
|
||||
<span><span class="op">)</span></span></code></pre></div>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">is.labelled</span><span class="op">(</span><span class="va">x</span>, classes <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"haven_labelled"</span>, <span class="st">"labelled"</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
|
@ -44,7 +44,13 @@
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="ref-usage">Usage<a class="anchor" aria-label="anchor" href="#ref-usage"></a></h2>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">named_levels</span><span class="op">(</span><span class="va">data</span>, label <span class="op">=</span> <span class="st">"labels"</span>, na.label <span class="op">=</span> <span class="cn">NULL</span>, na.value <span class="op">=</span> <span class="fl">99</span><span class="op">)</span></span></code></pre></div>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">named_levels</span><span class="op">(</span></span>
|
||||
<span> <span class="va">data</span>,</span>
|
||||
<span> label <span class="op">=</span> <span class="st">"labels"</span>,</span>
|
||||
<span> na.label <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> na.value <span class="op">=</span> <span class="fl">99</span>,</span>
|
||||
<span> sort.numeric <span class="op">=</span> <span class="cn">TRUE</span></span>
|
||||
<span><span class="op">)</span></span></code></pre></div>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
@ -67,6 +73,10 @@
|
||||
<dd><p>new value for NA strings. Ignored if na.label is NULL.
|
||||
Default is 99.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-sort-numeric">sort.numeric<a class="anchor" aria-label="anchor" href="#arg-sort-numeric"></a></dt>
|
||||
<dd><p>sort factor levels if levels are numeric. Default is TRUE</p></dd>
|
||||
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
|
||||
@ -75,14 +85,22 @@ Default is 99.</p></dd>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="kw">if</span> <span class="op">(</span><span class="cn">FALSE</span><span class="op">)</span> <span class="op">{</span> <span class="co"># \dontrun{</span></span></span>
|
||||
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/structure.html" class="external-link">structure</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">1</span>, <span class="fl">2</span>, <span class="fl">3</span>, <span class="fl">2</span>, <span class="fl">10</span>, <span class="fl">9</span><span class="op">)</span>,</span></span>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/structure.html" class="external-link">structure</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">1</span>, <span class="fl">2</span>, <span class="fl">3</span>, <span class="fl">2</span>, <span class="fl">10</span>, <span class="fl">9</span><span class="op">)</span>,</span></span>
|
||||
<span class="r-in"><span> labels <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span>Unknown <span class="op">=</span> <span class="fl">9</span>, Refused <span class="op">=</span> <span class="fl">10</span><span class="op">)</span>,</span></span>
|
||||
<span class="r-in"><span> class <span class="op">=</span> <span class="st">"haven_labelled"</span></span></span>
|
||||
<span class="r-in"><span><span class="op">)</span> <span class="op">|></span></span></span>
|
||||
<span class="r-in"><span> <span class="fu"><a href="as_factor.html">as_factor</a></span><span class="op">(</span><span class="op">)</span> <span class="op">|></span></span></span>
|
||||
<span class="r-in"><span> <span class="fu">named_levels</span><span class="op">(</span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="op">}</span> <span class="co"># }</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 2 3 Refused Unknown </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 2 3 10 9 </span>
|
||||
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/structure.html" class="external-link">structure</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">1</span>, <span class="fl">2</span>, <span class="fl">3</span>, <span class="fl">2</span>, <span class="fl">10</span>, <span class="fl">9</span><span class="op">)</span>,</span></span>
|
||||
<span class="r-in"><span> labels <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span>Unknown <span class="op">=</span> <span class="fl">9</span>, Refused <span class="op">=</span> <span class="fl">10</span><span class="op">)</span>,</span></span>
|
||||
<span class="r-in"><span> class <span class="op">=</span> <span class="st">"labelled"</span></span></span>
|
||||
<span class="r-in"><span><span class="op">)</span> <span class="op">|></span></span></span>
|
||||
<span class="r-in"><span> <span class="fu"><a href="as_factor.html">as_factor</a></span><span class="op">(</span><span class="op">)</span> <span class="op">|></span></span></span>
|
||||
<span class="r-in"><span> <span class="fu">named_levels</span><span class="op">(</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 2 3 Refused Unknown </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 2 3 10 9 </span>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
|
||||
|
93
reference/possibly_numeric.html
Normal file
93
reference/possibly_numeric.html
Normal file
@ -0,0 +1,93 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Tests if vector can be interpreted as numeric without introducing NAs by coercion — possibly_numeric • REDCapCAST</title><!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png"><link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png"><link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png"><link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="../deps/font-awesome-6.5.2/css/all.min.css" rel="stylesheet"><link href="../deps/font-awesome-6.5.2/css/v4-shims.min.css" rel="stylesheet"><script src="../deps/headroom-0.11.0/headroom.min.js"></script><script src="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="../deps/search-1.0.0/fuse.min.js"></script><script src="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Tests if vector can be interpreted as numeric without introducing NAs by coercion — possibly_numeric"><meta name="description" content="Tests if vector can be interpreted as numeric without introducing NAs by
|
||||
coercion"><meta property="og:description" content="Tests if vector can be interpreted as numeric without introducing NAs by
|
||||
coercion"><meta property="og:image" content="https://agdamsbo.github.io/REDCapCAST/logo.png"></head><body>
|
||||
<a href="#main" class="visually-hidden-focusable">Skip to contents</a>
|
||||
|
||||
|
||||
<nav class="navbar navbar-expand-lg fixed-top bg-light" data-bs-theme="light" aria-label="Site navigation"><div class="container">
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">REDCapCAST</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">24.11.4</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div id="navbar" class="collapse navbar-collapse ms-3">
|
||||
<ul class="navbar-nav me-auto"><li class="nav-item"><a class="nav-link" href="../articles/REDCapCAST.html">Get started</a></li>
|
||||
<li class="active nav-item"><a class="nav-link" href="../reference/index.html">Reference</a></li>
|
||||
<li class="nav-item dropdown">
|
||||
<button class="nav-link dropdown-toggle" type="button" id="dropdown-articles" data-bs-toggle="dropdown" aria-expanded="false" aria-haspopup="true">Articles</button>
|
||||
<ul class="dropdown-menu" aria-labelledby="dropdown-articles"><li><a class="dropdown-item" href="../articles/Database-creation.html">Database-creation</a></li>
|
||||
<li><a class="dropdown-item" href="../articles/Shiny-app.html">Shiny-app</a></li>
|
||||
</ul></li>
|
||||
<li class="nav-item"><a class="nav-link" href="../news/index.html">Changelog</a></li>
|
||||
</ul><ul class="navbar-nav"><li class="nav-item"><form class="form-inline" role="search">
|
||||
<input class="form-control" type="search" name="search-input" id="search-input" autocomplete="off" aria-label="Search site" placeholder="Search for" data-search-index="../search.json"></form></li>
|
||||
<li class="nav-item"><a class="external-link nav-link" href="https://github.com/agdamsbo/REDCapCAST/" aria-label="GitHub"><span class="fa fab fa-github fa-lg"></span></a></li>
|
||||
</ul></div>
|
||||
|
||||
|
||||
</div>
|
||||
</nav><div class="container template-reference-topic">
|
||||
<div class="row">
|
||||
<main id="main" class="col-md-9"><div class="page-header">
|
||||
<img src="../logo.png" class="logo" alt=""><h1>Tests if vector can be interpreted as numeric without introducing NAs by coercion</h1>
|
||||
<small class="dont-index">Source: <a href="https://github.com/agdamsbo/REDCapCAST/blob/main/R/as_factor.R" class="external-link"><code>R/as_factor.R</code></a></small>
|
||||
<div class="d-none name"><code>possibly_numeric.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description section level2">
|
||||
<p>Tests if vector can be interpreted as numeric without introducing NAs by
|
||||
coercion</p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="ref-usage">Usage<a class="anchor" aria-label="anchor" href="#ref-usage"></a></h2>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">possibly_numeric</span><span class="op">(</span><span class="va">data</span><span class="op">)</span></span></code></pre></div>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#arguments"></a></h2>
|
||||
|
||||
|
||||
<dl><dt id="arg-data">data<a class="anchor" aria-label="anchor" href="#arg-data"></a></dt>
|
||||
<dd><p>vector</p></dd>
|
||||
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
|
||||
<p>logical</p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"1"</span>,<span class="st">"5"</span><span class="op">)</span> <span class="op">|></span> <span class="fu">possibly_numeric</span><span class="op">(</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] TRUE</span>
|
||||
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"1"</span>,<span class="st">"5"</span>,<span class="st">"e"</span><span class="op">)</span> <span class="op">|></span> <span class="fu">possibly_numeric</span><span class="op">(</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] FALSE</span>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
|
||||
</nav></aside></div>
|
||||
|
||||
|
||||
<footer><div class="pkgdown-footer-left">
|
||||
<p>Developed by Andreas Gammelgaard Damsbo, Paul Egeler.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown-footer-right">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.1.1.</p>
|
||||
</div>
|
||||
|
||||
</footer></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body></html>
|
||||
|
@ -1,13 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Download REDCap data — read_redcap_tables • REDCapCAST</title><!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png"><link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png"><link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png"><link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="../deps/font-awesome-6.5.2/css/all.min.css" rel="stylesheet"><link href="../deps/font-awesome-6.5.2/css/v4-shims.min.css" rel="stylesheet"><script src="../deps/headroom-0.11.0/headroom.min.js"></script><script src="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="../deps/search-1.0.0/fuse.min.js"></script><script src="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Download REDCap data — read_redcap_tables"><meta name="description" content="Implementation of REDCap_split with a focused data acquisition approach using
|
||||
REDCapR::redcap_read and only downloading specified fields, forms and/or
|
||||
events using the built-in focused_metadata including some clean-up.
|
||||
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Download REDCap data — read_redcap_tables • REDCapCAST</title><!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png"><link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png"><link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png"><link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="../deps/font-awesome-6.5.2/css/all.min.css" rel="stylesheet"><link href="../deps/font-awesome-6.5.2/css/v4-shims.min.css" rel="stylesheet"><script src="../deps/headroom-0.11.0/headroom.min.js"></script><script src="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="../deps/search-1.0.0/fuse.min.js"></script><script src="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Download REDCap data — read_redcap_tables"><meta name="description" content="Implementation of passed on to REDCap_split with a focused
|
||||
data acquisition approach using passed on to redcap_read and
|
||||
only downloading specified fields, forms and/or events using the built-in
|
||||
focused_metadata including some clean-up.
|
||||
Works with classical and longitudinal projects with or without repeating
|
||||
instruments."><meta property="og:description" content="Implementation of REDCap_split with a focused data acquisition approach using
|
||||
REDCapR::redcap_read and only downloading specified fields, forms and/or
|
||||
events using the built-in focused_metadata including some clean-up.
|
||||
instruments.
|
||||
Will preserve metadata in the data.frames as labels."><meta property="og:description" content="Implementation of passed on to REDCap_split with a focused
|
||||
data acquisition approach using passed on to redcap_read and
|
||||
only downloading specified fields, forms and/or events using the built-in
|
||||
focused_metadata including some clean-up.
|
||||
Works with classical and longitudinal projects with or without repeating
|
||||
instruments."><meta property="og:image" content="https://agdamsbo.github.io/REDCapCAST/logo.png"></head><body>
|
||||
instruments.
|
||||
Will preserve metadata in the data.frames as labels."><meta property="og:image" content="https://agdamsbo.github.io/REDCapCAST/logo.png"></head><body>
|
||||
<a href="#main" class="visually-hidden-focusable">Skip to contents</a>
|
||||
|
||||
|
||||
@ -47,11 +51,13 @@ instruments."><meta property="og:image" content="https://agdamsbo.github.io/REDC
|
||||
</div>
|
||||
|
||||
<div class="ref-description section level2">
|
||||
<p>Implementation of REDCap_split with a focused data acquisition approach using
|
||||
REDCapR::redcap_read and only downloading specified fields, forms and/or
|
||||
events using the built-in focused_metadata including some clean-up.
|
||||
<p>Implementation of passed on to <a href="REDCap_split.html">REDCap_split</a> with a focused
|
||||
data acquisition approach using passed on to <a href="https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html" class="external-link">redcap_read</a> and
|
||||
only downloading specified fields, forms and/or events using the built-in
|
||||
focused_metadata including some clean-up.
|
||||
Works with classical and longitudinal projects with or without repeating
|
||||
instruments.</p>
|
||||
instruments.
|
||||
Will preserve metadata in the data.frames as labels.</p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
@ -63,8 +69,9 @@ instruments.</p>
|
||||
<span> fields <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> events <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> forms <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> raw_or_label <span class="op">=</span> <span class="st">"label"</span>,</span>
|
||||
<span> split_forms <span class="op">=</span> <span class="st">"all"</span></span>
|
||||
<span> raw_or_label <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"raw"</span>, <span class="st">"label"</span>, <span class="st">"both"</span><span class="op">)</span>,</span>
|
||||
<span> split_forms <span class="op">=</span> <span class="st">"all"</span>,</span>
|
||||
<span> <span class="va">...</span></span>
|
||||
<span><span class="op">)</span></span></code></pre></div>
|
||||
</div>
|
||||
|
||||
@ -97,19 +104,24 @@ instruments.</p>
|
||||
|
||||
|
||||
<dt id="arg-raw-or-label">raw_or_label<a class="anchor" aria-label="anchor" href="#arg-raw-or-label"></a></dt>
|
||||
<dd><p>raw or label tags. Can be</p>
|
||||
<p>* "raw": Standard [REDCapR] method to get raw values.
|
||||
* "label": Standard [REDCapR] method to get label values.
|
||||
<dd><p>raw or label tags. Can be "raw", "label" or "both".</p>
|
||||
<p>* "raw": Standard <a href="https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html" class="external-link">redcap_read</a> method to get raw values.
|
||||
* "label": Standard <a href="https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html" class="external-link">redcap_read</a> method to get label values.
|
||||
* "both": Get raw values with REDCap labels applied as labels. Use
|
||||
[as_factor()] to format factors with original labels and use the
|
||||
[gtsummary] package to easily get beautiful tables with original labels
|
||||
from REDCap. Use [fct_drop()] to drop empty levels.</p></dd>
|
||||
<a href="as_factor.html">as_factor</a> to format factors with original labels and use
|
||||
the `gtsummary` package functions like <a href="https://www.danieldsjoberg.com/gtsummary/reference/tbl_summary.html" class="external-link">tbl_summary</a> to
|
||||
easily get beautiful tables with original labels from REDCap. Use
|
||||
<a href="fct_drop.html">fct_drop</a> to drop empty levels.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-split-forms">split_forms<a class="anchor" aria-label="anchor" href="#arg-split-forms"></a></dt>
|
||||
<dd><p>Whether to split "repeating" or "all" forms, default is
|
||||
all.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg--">...<a class="anchor" aria-label="anchor" href="#arg--"></a></dt>
|
||||
<dd><p>passed on to <a href="https://ouhscbbmc.github.io/REDCapR/reference/redcap_read.html" class="external-link">redcap_read</a></p></dd>
|
||||
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
|
||||
|
@ -1,7 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Redcap Wider — redcap_wider • REDCapCAST</title><!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png"><link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png"><link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png"><link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="../deps/font-awesome-6.5.2/css/all.min.css" rel="stylesheet"><link href="../deps/font-awesome-6.5.2/css/v4-shims.min.css" rel="stylesheet"><script src="../deps/headroom-0.11.0/headroom.min.js"></script><script src="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="../deps/search-1.0.0/fuse.min.js"></script><script src="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Redcap Wider — redcap_wider"><meta name="description" content="Converts a list of REDCap data frames from long to wide format.
|
||||
Handles longitudinal projects, but not yet repeated instruments."><meta property="og:description" content="Converts a list of REDCap data frames from long to wide format.
|
||||
Handles longitudinal projects, but not yet repeated instruments."><meta property="og:image" content="https://agdamsbo.github.io/REDCapCAST/logo.png"></head><body>
|
||||
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Transforms list of REDCap data.frames to a single wide data.frame — redcap_wider • REDCapCAST</title><!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png"><link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png"><link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png"><link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="../deps/font-awesome-6.5.2/css/all.min.css" rel="stylesheet"><link href="../deps/font-awesome-6.5.2/css/v4-shims.min.css" rel="stylesheet"><script src="../deps/headroom-0.11.0/headroom.min.js"></script><script src="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="../deps/search-1.0.0/fuse.min.js"></script><script src="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Transforms list of REDCap data.frames to a single wide data.frame — redcap_wider"><meta name="description" content="Converts a list of REDCap data.frames from long to wide format.
|
||||
In essence it is a wrapper for the pivot_wider function applied
|
||||
on a REDCap output (from read_redcap_tables) or manually
|
||||
split by REDCap_split."><meta property="og:description" content="Converts a list of REDCap data.frames from long to wide format.
|
||||
In essence it is a wrapper for the pivot_wider function applied
|
||||
on a REDCap output (from read_redcap_tables) or manually
|
||||
split by REDCap_split."><meta property="og:image" content="https://agdamsbo.github.io/REDCapCAST/logo.png"></head><body>
|
||||
<a href="#main" class="visually-hidden-focusable">Skip to contents</a>
|
||||
|
||||
|
||||
@ -35,14 +39,16 @@ Handles longitudinal projects, but not yet repeated instruments."><meta property
|
||||
</nav><div class="container template-reference-topic">
|
||||
<div class="row">
|
||||
<main id="main" class="col-md-9"><div class="page-header">
|
||||
<img src="../logo.png" class="logo" alt=""><h1>Redcap Wider</h1>
|
||||
<img src="../logo.png" class="logo" alt=""><h1>Transforms list of REDCap data.frames to a single wide data.frame</h1>
|
||||
<small class="dont-index">Source: <a href="https://github.com/agdamsbo/REDCapCAST/blob/main/R/redcap_wider.R" class="external-link"><code>R/redcap_wider.R</code></a></small>
|
||||
<div class="d-none name"><code>redcap_wider.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description section level2">
|
||||
<p>Converts a list of REDCap data frames from long to wide format.
|
||||
Handles longitudinal projects, but not yet repeated instruments.</p>
|
||||
<p>Converts a list of REDCap data.frames from long to wide format.
|
||||
In essence it is a wrapper for the <a href="https://tidyr.tidyverse.org/reference/pivot_wider.html" class="external-link">pivot_wider</a> function applied
|
||||
on a REDCap output (from <a href="read_redcap_tables.html">read_redcap_tables</a>) or manually
|
||||
split by <a href="REDCap_split.html">REDCap_split</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
@ -59,20 +65,20 @@ Handles longitudinal projects, but not yet repeated instruments.</p>
|
||||
|
||||
|
||||
<dl><dt id="arg-data">data<a class="anchor" aria-label="anchor" href="#arg-data"></a></dt>
|
||||
<dd><p>A list of data frames.</p></dd>
|
||||
<dd><p>A list of data frames</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-event-glue">event.glue<a class="anchor" aria-label="anchor" href="#arg-event-glue"></a></dt>
|
||||
<dd><p>A dplyr::glue string for repeated events naming</p></dd>
|
||||
<dd><p>A <a href="https://glue.tidyverse.org/reference/glue.html" class="external-link">glue</a> string for repeated events naming</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-inst-glue">inst.glue<a class="anchor" aria-label="anchor" href="#arg-inst-glue"></a></dt>
|
||||
<dd><p>A dplyr::glue string for repeated instruments naming</p></dd>
|
||||
<dd><p>A <a href="https://glue.tidyverse.org/reference/glue.html" class="external-link">glue</a> string for repeated instruments naming</p></dd>
|
||||
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
|
||||
<p>The list of data frames in wide format.</p>
|
||||
<p>data.frame in wide format</p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
@ -92,9 +98,11 @@ Handles longitudinal projects, but not yet repeated instruments.</p>
|
||||
<span class="r-in"><span><span class="op">)</span></span></span>
|
||||
<span class="r-in"><span><span class="fu">redcap_wider</span><span class="op">(</span><span class="va">list1</span><span class="op">)</span></span></span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> Joining with `by = join_by(record_id)`</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 2 × 4</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> record_id age_baseline age_followup gender</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 1 25 27 male</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 2 26 28 female</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><dbl></span> <span style="color: #949494; font-style: italic;"><dbl></span> <span style="color: #949494; font-style: italic;"><dbl></span> <span style="color: #949494; font-style: italic;"><chr></span> </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> 1 25 27 male </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> 2 26 28 female</span>
|
||||
<span class="r-in"><span><span class="co"># Simpel with two instruments</span></span></span>
|
||||
<span class="r-in"><span><span class="va">list2</span> <span class="op"><-</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html" class="external-link">list</a></span><span class="op">(</span></span></span>
|
||||
<span class="r-in"><span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a></span><span class="op">(</span></span></span>
|
||||
@ -146,12 +154,13 @@ Handles longitudinal projects, but not yet repeated instruments.</p>
|
||||
<span class="r-in"><span><span class="fu">redcap_wider</span><span class="op">(</span><span class="va">list4</span><span class="op">)</span></span></span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> Joining with `by = join_by(record_id)`</span>
|
||||
<span class="r-msg co"><span class="r-pr">#></span> Joining with `by = join_by(record_id)`</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># A tibble: 2 × 8</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> record_id age_baseline age_followup dist_1_baseline dist_1_followup</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 1 25 27 40 25</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 2 26 28 28 23</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> dist_2_baseline dist_2_followup gender</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 32 33 male</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 2 24 36 female</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494; font-style: italic;"><dbl></span> <span style="color: #949494; font-style: italic;"><dbl></span> <span style="color: #949494; font-style: italic;"><dbl></span> <span style="color: #949494; font-style: italic;"><dbl></span> <span style="color: #949494; font-style: italic;"><dbl></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">1</span> 1 25 27 40 25</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #BCBCBC;">2</span> 2 26 28 28 23</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># ℹ 3 more variables: dist_2_baseline <dbl>, dist_2_followup <dbl>,</span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> <span style="color: #949494;"># gender <chr></span></span>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
|
||||
|
@ -47,7 +47,9 @@
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">sanitize_split</span><span class="op">(</span></span>
|
||||
<span> <span class="va">l</span>,</span>
|
||||
<span> generic.names <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"redcap_event_name"</span>, <span class="st">"redcap_repeat_instrument"</span>,</span>
|
||||
<span> <span class="st">"redcap_repeat_instance"</span><span class="op">)</span></span>
|
||||
<span> <span class="st">"redcap_repeat_instance"</span><span class="op">)</span>,</span>
|
||||
<span> drop.complete <span class="op">=</span> <span class="cn">TRUE</span>,</span>
|
||||
<span> drop.empty <span class="op">=</span> <span class="cn">TRUE</span></span>
|
||||
<span><span class="op">)</span></span></code></pre></div>
|
||||
</div>
|
||||
|
||||
@ -62,6 +64,15 @@
|
||||
<dt id="arg-generic-names">generic.names<a class="anchor" aria-label="anchor" href="#arg-generic-names"></a></dt>
|
||||
<dd><p>A vector of generic names to be excluded.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-drop-complete">drop.complete<a class="anchor" aria-label="anchor" href="#arg-drop-complete"></a></dt>
|
||||
<dd><p>logical to remove genric REDCap variables indicating
|
||||
instrument completion. Default is TRUE.</p></dd>
|
||||
|
||||
|
||||
<dt id="arg-drop-empty">drop.empty<a class="anchor" aria-label="anchor" href="#arg-drop-empty"></a></dt>
|
||||
<dd><p>logical to remove variables with only NAs Default is TRUE.</p></dd>
|
||||
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
|
||||
|
@ -73,15 +73,15 @@ factoring, but levels character vectors in order of appearance.</p>
|
||||
<span class="r-in"><span> <span class="fu">var2fct</span><span class="op">(</span><span class="fl">6</span><span class="op">)</span> <span class="op">|></span></span></span>
|
||||
<span class="r-in"><span> <span class="fu"><a href="https://rdrr.io/r/base/summary.html" class="external-link">summary</a></span><span class="op">(</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 1 2 3 4 </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 9 2 6 3 </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 7 3 6 4 </span>
|
||||
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/sample.html" class="external-link">sample</a></span><span class="op">(</span><span class="va">letters</span>, <span class="fl">20</span><span class="op">)</span> <span class="op">|></span></span></span>
|
||||
<span class="r-in"><span> <span class="fu">var2fct</span><span class="op">(</span><span class="fl">6</span><span class="op">)</span> <span class="op">|></span></span></span>
|
||||
<span class="r-in"><span> <span class="fu"><a href="https://rdrr.io/r/base/summary.html" class="external-link">summary</a></span><span class="op">(</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> Length Class Mode </span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> 20 character character </span>
|
||||
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/sample.html" class="external-link">sample</a></span><span class="op">(</span><span class="va">letters</span><span class="op">[</span><span class="fl">1</span><span class="op">:</span><span class="fl">4</span><span class="op">]</span>, <span class="fl">20</span>, <span class="cn">TRUE</span><span class="op">)</span> <span class="op">|></span> <span class="fu">var2fct</span><span class="op">(</span><span class="fl">6</span><span class="op">)</span></span></span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] c d c d a b d a d c a d a c c a b c d c</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> Levels: c d a b</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> [1] a c c a b c d c c b d b a d d c b d b a</span>
|
||||
<span class="r-out co"><span class="r-pr">#></span> Levels: a c b d</span>
|
||||
</code></pre></div>
|
||||
</div>
|
||||
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
|
||||
|
File diff suppressed because one or more lines are too long
@ -35,6 +35,7 @@
|
||||
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/fct_drop.html</loc></url>
|
||||
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/file_extension.html</loc></url>
|
||||
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/focused_metadata.html</loc></url>
|
||||
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/format_redcap_factor.html</loc></url>
|
||||
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/format_subheader.html</loc></url>
|
||||
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/get_api_key.html</loc></url>
|
||||
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/get_attr.html</loc></url>
|
||||
@ -55,6 +56,7 @@
|
||||
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/nav_bar_page.html</loc></url>
|
||||
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/numchar2fct.html</loc></url>
|
||||
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/parse_data.html</loc></url>
|
||||
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/possibly_numeric.html</loc></url>
|
||||
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/possibly_roman.html</loc></url>
|
||||
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.character.html</loc></url>
|
||||
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.data.frame.html</loc></url>
|
||||
|
Loading…
Reference in New Issue
Block a user