Deploying to gh-pages from @ agdamsbo/REDCapCAST@f5965a2748 🚀

This commit is contained in:
agdamsbo 2024-11-19 12:05:57 +00:00
parent 56074184f0
commit 0e49189253
9 changed files with 331 additions and 8 deletions

View File

@ -178,8 +178,8 @@ and launch the app as follows:</p>
<span><span class="co">#&gt; $ mrs_complete_inclusion : chr [1:6] "Incomplete" "Incomplete" NA NA ...</span></span>
<span><span class="co">#&gt; $ mrs_complete_follow1 : chr [1:6] NA "Incomplete" "Incomplete" NA ...</span></span>
<span><span class="co">#&gt; $ mrs_complete_follow2 : chr [1:6] NA NA "Incomplete" NA ...</span></span>
<span><span class="co">#&gt; $ con_mrs : logi [1:6] NA NA NA NA NA NA</span></span>
<span><span class="co">#&gt; $ con_calc : logi [1:6] NA NA NA NA NA NA</span></span>
<span><span class="co">#&gt; $ con_mrs : Factor w/ 2 levels "FALSE","TRUE": NA NA NA NA NA NA</span></span>
<span><span class="co">#&gt; $ con_calc : Factor w/ 2 levels "FALSE","TRUE": NA NA NA NA NA NA</span></span>
<span><span class="co">#&gt; $ consensus_complete : chr [1:6] NA NA NA NA ...</span></span>
<span><span class="co">#&gt; $ event_datetime_1_follow1 : POSIXct[1:6], format: NA "2024-01-18 12:49:42" ...</span></span>
<span><span class="co">#&gt; $ event_datetime_1_follow2 : POSIXct[1:6], format: NA NA ...</span></span>
@ -223,7 +223,7 @@ and launch the app as follows:</p>
<span><span class="co">#&gt; <span style="color: #BCBCBC;"> 8</span> sex data <span style="color: #BB0000;">NA</span> text sex </span></span>
<span><span class="co">#&gt; <span style="color: #BCBCBC;"> 9</span> cohabitation data <span style="color: #BB0000;">NA</span> text cohabitation </span></span>
<span><span class="co">#&gt; <span style="color: #BCBCBC;">10</span> hypertension data <span style="color: #BB0000;">NA</span> text hypertension </span></span>
<span><span class="co">#&gt; <span style="color: #949494;"># 13 more variables: select_choices_or_calculations &lt;lgl&gt;, field_note &lt;lgl&gt;,</span></span></span>
<span><span class="co">#&gt; <span style="color: #949494;"># 13 more variables: select_choices_or_calculations &lt;chr&gt;, field_note &lt;lgl&gt;,</span></span></span>
<span><span class="co">#&gt; <span style="color: #949494;"># text_validation_type_or_show_slider_number &lt;chr&gt;,</span></span></span>
<span><span class="co">#&gt; <span style="color: #949494;"># text_validation_min &lt;lgl&gt;, text_validation_max &lt;lgl&gt;, identifier &lt;lgl&gt;,</span></span></span>
<span><span class="co">#&gt; <span style="color: #949494;"># branching_logic &lt;lgl&gt;, required_field &lt;lgl&gt;, custom_alignment &lt;lgl&gt;,</span></span></span>

View File

@ -5,7 +5,7 @@ articles:
Database-creation: Database-creation.html
REDCapCAST: REDCapCAST.html
Shiny-app: Shiny-app.html
last_built: 2024-11-18T16:09Z
last_built: 2024-11-19T12:05Z
urls:
reference: https://agdamsbo.github.io/REDCapCAST/reference
article: https://agdamsbo.github.io/REDCapCAST/articles

View File

@ -55,7 +55,8 @@
<span> field.label <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span> field.label.attr <span class="op">=</span> <span class="st">"label"</span>,</span>
<span> field.validation <span class="op">=</span> <span class="cn">NULL</span>,</span>
<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="redcapcast_meta.html">redcapcast_meta</a></span><span class="op">)</span></span>
<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="redcapcast_meta.html">redcapcast_meta</a></span><span class="op">)</span>,</span>
<span> convert.logicals <span class="op">=</span> <span class="cn">TRUE</span></span>
<span><span class="op">)</span></span></code></pre></div>
</div>
@ -121,6 +122,10 @@ file with `haven::read_dta()`).</p></dd>
<dd><p>redcap metadata headings. Default is
REDCapCAST:::metadata_names.</p></dd>
<dt id="arg-convert-logicals">convert.logicals<a class="anchor" aria-label="anchor" href="#arg-convert-logicals"></a></dt>
<dd><p>convert logicals to factor. 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>
@ -158,7 +163,7 @@ Please, do always inspect the data dictionary before upload.</p>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># dob &lt;date&gt;, age &lt;dbl&gt;, age_integer &lt;dbl&gt;, sex &lt;chr&gt;, cohabitation &lt;chr&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># hypertension &lt;chr&gt;, diabetes &lt;chr&gt;, region &lt;chr&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># baseline_data_start_complete &lt;chr&gt;, mrs_assessed &lt;chr&gt;, mrs_date &lt;date&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># mrs_score &lt;dbl&gt;, mrs_complete &lt;chr&gt;, con_mrs &lt;lgl&gt;, con_calc &lt;lgl&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># mrs_score &lt;dbl&gt;, mrs_complete &lt;chr&gt;, con_mrs &lt;fct&gt;, con_calc &lt;fct&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># consensus_complete &lt;chr&gt;, event_datetime &lt;dttm&gt;, event_age &lt;dbl&gt;, …</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $meta</span>
@ -176,7 +181,7 @@ Please, do always inspect the data dictionary before upload.</p>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> age data <span style="color: #BB0000;">NA</span> text age </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> age_integer data <span style="color: #BB0000;">NA</span> text age_integer </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># 17 more rows</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># 13 more variables: select_choices_or_calculations &lt;lgl&gt;, field_note &lt;lgl&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># 13 more variables: select_choices_or_calculations &lt;chr&gt;, field_note &lt;lgl&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># text_validation_type_or_show_slider_number &lt;chr&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># text_validation_min &lt;lgl&gt;, text_validation_max &lt;lgl&gt;, identifier &lt;lgl&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># branching_logic &lt;lgl&gt;, required_field &lt;lgl&gt;, custom_alignment &lt;lgl&gt;,</span></span>

204
reference/get_attr.html Normal file
View File

@ -0,0 +1,204 @@
<!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>Extract attribute. Returns NA if none — get_attr • 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="Extract attribute. Returns NA if none — get_attr"><meta name="description" content="Extract attribute. Returns NA if none"><meta property="og:description" content="Extract attribute. Returns NA if none"><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.2</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>Extract attribute. Returns NA if none</h1>
<small class="dont-index">Source: <a href="https://github.com/agdamsbo/REDCapCAST/blob/main/R/ds2dd_detailed.R" class="external-link"><code>R/ds2dd_detailed.R</code></a></small>
<div class="d-none name"><code>get_attr.Rd</code></div>
</div>
<div class="ref-description section level2">
<p>Extract attribute. Returns NA if none</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_attr</span><span class="op">(</span><span class="va">data</span>, attr <span class="op">=</span> <span class="cn">NULL</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-attr">attr<a class="anchor" aria-label="anchor" href="#arg-attr"></a></dt>
<dd><p>attribute name</p></dd>
</dl></div>
<div class="section level2">
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
<p>character vector</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/attr.html" class="external-link">attr</a></span><span class="op">(</span><span class="va">mtcars</span><span class="op">$</span><span class="va">mpg</span>, <span class="st">"label"</span><span class="op">)</span> <span class="op">&lt;-</span> <span class="st">"testing"</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/lapply.html" class="external-link">sapply</a></span><span class="op">(</span><span class="va">mtcars</span>, <span class="va">get_attr</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $mpg</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $mpg$label</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "testing"</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $cyl</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> NULL</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $disp</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> NULL</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $hp</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> NULL</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $drat</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> NULL</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $wt</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> NULL</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $qsec</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> NULL</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $vs</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> NULL</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $am</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> NULL</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $gear</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> NULL</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $carb</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> NULL</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/lapply.html" class="external-link">lapply</a></span><span class="op">(</span><span class="va">mtcars</span>, \<span class="op">(</span><span class="va">.x</span><span class="op">)</span><span class="fu">get_attr</span><span class="op">(</span><span class="va">.x</span>, <span class="cn">NULL</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $mpg</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $mpg$label</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "testing"</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $cyl</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> NULL</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $disp</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> NULL</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $hp</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> NULL</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $drat</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> NULL</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $wt</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> NULL</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $qsec</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> NULL</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $vs</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> NULL</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $am</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> NULL</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $gear</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> NULL</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $carb</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> NULL</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-in"><span><span class="va">mtcars</span> <span class="op">|&gt;</span></span></span>
<span class="r-in"><span> <span class="fu"><a href="numchar2fct.html">numchar2fct</a></span><span class="op">(</span>numeric.threshold <span class="op">=</span> <span class="fl">6</span><span class="op">)</span> <span class="op">|&gt;</span></span></span>
<span class="r-in"><span> <span class="fu"><a href="ds2dd_detailed.html">ds2dd_detailed</a></span><span class="op">(</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $data</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 32 × 11</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> mpg cyl disp hp drat wt qsec vs am gear carb </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;fct&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;dbl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;fct&gt;</span> <span style="color: #949494; font-style: italic;">&lt;fct&gt;</span> <span style="color: #949494; font-style: italic;">&lt;fct&gt;</span> <span style="color: #949494; font-style: italic;">&lt;fct&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 21 6 160 110 3.9 2.62 16.5 0 1 4 4 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 21 6 160 110 3.9 2.88 17.0 0 1 4 4 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 22.8 4 108 93 3.85 2.32 18.6 1 1 4 1 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 21.4 6 258 110 3.08 3.22 19.4 1 0 3 1 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 18.7 8 360 175 3.15 3.44 17.0 0 0 3 2 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 18.1 6 225 105 2.76 3.46 20.2 1 0 3 1 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 14.3 8 360 245 3.21 3.57 15.8 0 0 3 4 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 24.4 4 147. 62 3.69 3.19 20 1 0 4 2 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 22.8 4 141. 95 3.92 3.15 22.9 1 0 4 2 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 19.2 6 168. 123 3.92 3.44 18.3 1 0 4 4 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># 22 more rows</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $meta</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 11 × 18</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> field_name form_name section_header field_type field_label</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;lgl&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> mpg data <span style="color: #BB0000;">NA</span> text testing </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> cyl data <span style="color: #BB0000;">NA</span> radio cyl </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> disp data <span style="color: #BB0000;">NA</span> text disp </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> hp data <span style="color: #BB0000;">NA</span> text hp </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> drat data <span style="color: #BB0000;">NA</span> text drat </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> wt data <span style="color: #BB0000;">NA</span> text wt </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> qsec data <span style="color: #BB0000;">NA</span> text qsec </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> vs data <span style="color: #BB0000;">NA</span> radio vs </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> am data <span style="color: #BB0000;">NA</span> radio am </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> gear data <span style="color: #BB0000;">NA</span> radio gear </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">11</span> carb data <span style="color: #BB0000;">NA</span> radio carb </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># 13 more variables: select_choices_or_calculations &lt;chr&gt;, field_note &lt;lgl&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># text_validation_type_or_show_slider_number &lt;chr&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># text_validation_min &lt;lgl&gt;, text_validation_max &lt;lgl&gt;, identifier &lt;lgl&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># branching_logic &lt;lgl&gt;, required_field &lt;lgl&gt;, custom_alignment &lt;lgl&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># question_number &lt;lgl&gt;, matrix_group_name &lt;lgl&gt;, matrix_ranking &lt;lgl&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># field_annotation &lt;lgl&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</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>
<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>

View File

@ -66,6 +66,16 @@
<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></span>
<span class="r-in"><span><span class="fu">labelled</span><span class="fu">::</span><span class="fu">is.labelled</span><span class="op">(</span><span class="va">ds</span><span class="op">)</span></span></span>
<span class="r-err co"><span class="r-pr">#&gt;</span> <span class="error">Error in loadNamespace(x):</span> there is no package called labelled</span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/attributes.html" class="external-link">attributes</a></span><span class="op">(</span><span class="va">ds</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $labels</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Unknown Refused </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 9 10 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $class</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "haven_labelled"</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> </span>
<span class="r-in"><span><span class="va">ds</span> <span class="op">|&gt;</span> <span class="fu">haven_all_levels</span><span class="op">(</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 2 3 Unknown Refused </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 1 2 3 9 10 </span>

View File

@ -151,6 +151,12 @@
<dd>Retrieve project API key if stored, if not, set and retrieve</dd>
</dl><dl><dt>
<code><a href="get_attr.html">get_attr()</a></code>
</dt>
<dd>Extract attribute. Returns NA if none</dd>
</dl><dl><dt>
<code><a href="get_id_name.html">get_id_name()</a></code>
</dt>
@ -307,6 +313,12 @@
<dd>Sanitize list of data frames</dd>
</dl><dl><dt>
<code><a href="set_attr.html">set_attr()</a></code>
</dt>
<dd>Set attributes for named attribute. Appends if attr is NULL</dd>
</dl><dl><dt>
<code><a href="shiny_cast.html">shiny_cast()</a></code>
</dt>

90
reference/set_attr.html Normal file
View File

@ -0,0 +1,90 @@
<!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>Set attributes for named attribute. Appends if attr is NULL — set_attr • 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="Set attributes for named attribute. Appends if attr is NULL — set_attr"><meta name="description" content="Set attributes for named attribute. Appends if attr is NULL"><meta property="og:description" content="Set attributes for named attribute. Appends if attr is NULL"><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.2</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>Set attributes for named attribute. Appends if attr is NULL</h1>
<small class="dont-index">Source: <a href="https://github.com/agdamsbo/REDCapCAST/blob/main/R/ds2dd_detailed.R" class="external-link"><code>R/ds2dd_detailed.R</code></a></small>
<div class="d-none name"><code>set_attr.Rd</code></div>
</div>
<div class="ref-description section level2">
<p>Set attributes for named attribute. Appends if attr is NULL</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">set_attr</span><span class="op">(</span><span class="va">data</span>, <span class="va">label</span>, attr <span class="op">=</span> <span class="cn">NULL</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-label">label<a class="anchor" aria-label="anchor" href="#arg-label"></a></dt>
<dd><p>label</p></dd>
<dt id="arg-attr">attr<a class="anchor" aria-label="anchor" href="#arg-attr"></a></dt>
<dd><p>attribute name</p></dd>
</dl></div>
<div class="section level2">
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
<p>vector with attribute</p>
</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>

File diff suppressed because one or more lines are too long

View File

@ -27,6 +27,7 @@
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/focused_metadata.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>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/get_id_name.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/guess_time_only.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/guess_time_only_filter.html</loc></url>
@ -54,6 +55,7 @@
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/redcapcast_meta.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/replace_curly_quote.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/sanitize_split.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/set_attr.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/shiny_cast.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/split_non_repeating_forms.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/strsplitx.html</loc></url>