Deploying to gh-pages from @ agdamsbo/REDCapCAST@40d95e41c3 🚀

This commit is contained in:
agdamsbo 2024-11-21 10:30:17 +00:00
parent 220a333a7b
commit fe8dc66c90
13 changed files with 622 additions and 25 deletions

View File

@ -5,7 +5,7 @@ articles:
Database-creation: Database-creation.html Database-creation: Database-creation.html
REDCapCAST: REDCapCAST.html REDCapCAST: REDCapCAST.html
Shiny-app: Shiny-app.html Shiny-app: Shiny-app.html
last_built: 2024-11-20T15:36Z last_built: 2024-11-21T10:29Z
urls: urls:
reference: https://agdamsbo.github.io/REDCapCAST/reference reference: https://agdamsbo.github.io/REDCapCAST/reference
article: https://agdamsbo.github.io/REDCapCAST/articles article: https://agdamsbo.github.io/REDCapCAST/articles

88
reference/all_na.html Normal file
View File

@ -0,0 +1,88 @@
<!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>Check if vector is all NA — all_na • 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="Check if vector is all NA — all_na"><meta name="description" content="Check if vector is all NA"><meta property="og:description" content="Check if vector is all NA"><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>Check if vector is all NA</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>all_na.Rd</code></div>
</div>
<div class="ref-description section level2">
<p>Check if vector is all NA</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">all_na</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 of data.frame</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/rep.html" class="external-link">rep</a></span><span class="op">(</span><span class="cn">NA</span>,<span class="fl">4</span><span class="op">)</span> <span class="op">|&gt;</span> <span class="fu">all_na</span><span class="op">(</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] TRUE</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>

106
reference/compact_vec.html Normal file
View File

@ -0,0 +1,106 @@
<!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>Compacting a vector of any length with or without names — compact_vec • 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="Compacting a vector of any length with or without names — compact_vec"><meta name="description" content="Compacting a vector of any length with or without names"><meta property="og:description" content="Compacting a vector of any length with or without names"><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>Compacting a vector of any length with or without names</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>compact_vec.Rd</code></div>
</div>
<div class="ref-description section level2">
<p>Compacting a vector of any length with or without names</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">compact_vec</span><span class="op">(</span><span class="va">data</span>, nm.sep <span class="op">=</span> <span class="st">": "</span>, val.sep <span class="op">=</span> <span class="st">"; "</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, optionally named</p></dd>
<dt id="arg-nm-sep">nm.sep<a class="anchor" aria-label="anchor" href="#arg-nm-sep"></a></dt>
<dd><p>string separating name from value if any</p></dd>
<dt id="arg-val-sep">val.sep<a class="anchor" aria-label="anchor" href="#arg-val-sep"></a></dt>
<dd><p>string separating values</p></dd>
</dl></div>
<div class="section level2">
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
<p>character string</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/sample.html" class="external-link">sample</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/seq.html" class="external-link">seq_len</a></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">|&gt;</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">|&gt;</span></span></span>
<span class="r-in"><span> <span class="fu"><a href="named_levels.html">named_levels</a></span><span class="op">(</span><span class="op">)</span> <span class="op">|&gt;</span></span></span>
<span class="r-in"><span> <span class="fu"><a href="https://rdrr.io/r/base/sort.html" class="external-link">sort</a></span><span class="op">(</span><span class="op">)</span> <span class="op">|&gt;</span></span></span>
<span class="r-in"><span> <span class="fu">compact_vec</span><span class="op">(</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "1: 1; 2: 2; 3: 3; 4: 4"</span>
<span class="r-in"><span><span class="fl">1</span><span class="op">:</span><span class="fl">6</span> <span class="op">|&gt;</span> <span class="fu">compact_vec</span><span class="op">(</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "1; 2; 3; 4; 5; 6"</span>
<span class="r-in"><span><span class="st">"test"</span> <span class="op">|&gt;</span> <span class="fu">compact_vec</span><span class="op">(</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "test"</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">9</span><span class="op">]</span>, <span class="fl">20</span>, <span class="cn">TRUE</span><span class="op">)</span> <span class="op">|&gt;</span> <span class="fu">compact_vec</span><span class="op">(</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "g; e; e; b; f; d; b; c; i; f; g; e; f; i; f; e; b; a; d; h"</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

@ -91,7 +91,6 @@ Default is TRUE.</p></dd>
<span class="r-in"><span> <span class="op">)</span></span></span> <span class="r-in"><span> <span class="op">)</span></span></span>
<span class="r-in"><span> <span class="op">)</span> <span class="op">|&gt;</span></span></span> <span class="r-in"><span> <span class="op">)</span> <span class="op">|&gt;</span></span></span>
<span class="r-in"><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">"meta"</span><span class="op">)</span></span></span> <span class="r-in"><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">"meta"</span><span class="op">)</span></span></span>
<span class="r-msg co"><span class="r-pr">#&gt;</span> A default id column has been added</span>
<span class="r-in"><span><span class="co"># data |&gt; create_instrument_meta()</span></span></span> <span class="r-in"><span><span class="co"># data |&gt; create_instrument_meta()</span></span></span>
<span class="r-in"><span></span></span> <span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">data</span> <span class="op">&lt;-</span> <span class="va">iris</span> <span class="op">|&gt;</span></span></span> <span class="r-in"><span><span class="va">data</span> <span class="op">&lt;-</span> <span class="va">iris</span> <span class="op">|&gt;</span></span></span>
@ -103,7 +102,7 @@ Default is TRUE.</p></dd>
<span class="r-in"><span> <span class="fu"><a href="ds2dd_detailed.html">ds2dd_detailed</a></span><span class="op">(</span>form.sep <span class="op">=</span> <span class="st">"__"</span><span class="op">)</span></span></span> <span class="r-in"><span> <span class="fu"><a href="ds2dd_detailed.html">ds2dd_detailed</a></span><span class="op">(</span>form.sep <span class="op">=</span> <span class="st">"__"</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> $data</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 150 × 5</span></span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 150 × 5</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> Sepal.Length Sepal.Width Petal.Length Petal.Width Species</span> <span class="r-out co"><span class="r-pr">#&gt;</span> sepal.length sepal.width petal.length petal.width species</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;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> <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;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>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 5.1 3.5 1.4 0.2 setosa </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 5.1 3.5 1.4 0.2 setosa </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 4.9 3 1.4 0.2 setosa </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 4.9 3 1.4 0.2 setosa </span>
@ -121,11 +120,11 @@ Default is TRUE.</p></dd>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 5 × 18</span></span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 5 × 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> 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: #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> Sepal.Length b <span style="color: #BB0000;">NA</span> text Sepal.Length</span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">1</span> sepal.length b <span style="color: #BB0000;">NA</span> text Sepal.Length</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> Sepal.Width b <span style="color: #BB0000;">NA</span> text Sepal.Width </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> sepal.width b <span style="color: #BB0000;">NA</span> text Sepal.Width </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> Petal.Length b <span style="color: #BB0000;">NA</span> text Petal.Length</span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> petal.length b <span style="color: #BB0000;">NA</span> text Petal.Length</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> Petal.Width b <span style="color: #BB0000;">NA</span> text Petal.Width </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> petal.width b <span style="color: #BB0000;">NA</span> text Petal.Width </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">5</span> Species b <span style="color: #BB0000;">NA</span> radio Species </span> <span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">5</span> species b <span style="color: #BB0000;">NA</span> radio Species </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;"># 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_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;"># text_validation_min &lt;lgl&gt;, text_validation_max &lt;lgl&gt;, identifier &lt;lgl&gt;,</span></span>

View File

@ -142,24 +142,201 @@ Please, do always inspect the data dictionary before upload.</p>
<div class="section level2"> <div class="section level2">
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2> <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> <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="co">## Basic parsing with default options</span></span></span>
<span class="r-in"><span><span class="va">data</span> <span class="op">&lt;-</span> <span class="fu">REDCapCAST</span><span class="fu">::</span><span class="va"><a href="redcapcast_data.html">redcapcast_data</a></span></span></span> <span class="r-in"><span><span class="fu">REDCapCAST</span><span class="fu">::</span><span class="va"><a href="redcapcast_data.html">redcapcast_data</a></span> <span class="op">|&gt;</span></span></span>
<span class="r-in"><span><span class="va">data</span> <span class="op">|&gt;</span> <span class="fu">ds2dd_detailed</span><span class="op">(</span><span class="op">)</span></span></span> <span class="r-in"><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="op">-</span><span class="fu">dplyr</span><span class="fu">::</span><span class="fu"><a href="https://tidyselect.r-lib.org/reference/starts_with.html" class="external-link">starts_with</a></span><span class="op">(</span><span class="st">"redcap_"</span><span class="op">)</span><span class="op">)</span> <span class="op">|&gt;</span></span></span>
<span class="r-in"><span> <span class="fu">ds2dd_detailed</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: 25 × 24</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> record_id cpr inclusion inclusion_time dob age age_integer sex </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;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;date&gt;</span> <span style="color: #949494; font-style: italic;">&lt;chr&gt;</span> <span style="color: #949494; font-style: italic;">&lt;date&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;chr&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 1 12034… 2023-03-13 12:38:49 1940-03-12 83.0 83 fema…</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 2 01023… 2023-03-01 10:38:57 1934-02-01 89.1 89 male </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 2 <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 2 <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 3 23015… 2022-03-08 12:01:07 1956-01-23 66.1 66 male </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 3 <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 3 <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 3 <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 3 <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 3 <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> <span style="color: #BB0000;">NA</span> </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># 15 more rows</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># 16 more variables: cohabitation &lt;chr&gt;, hypertension &lt;chr&gt;, diabetes &lt;chr&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># region &lt;chr&gt;, baseline_data_start_complete &lt;chr&gt;, mrs_assessed &lt;chr&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># mrs_date &lt;date&gt;, mrs_score &lt;dbl&gt;, mrs_complete &lt;chr&gt;, con_mrs &lt;fct&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># con_calc &lt;fct&gt;, consensus_complete &lt;chr&gt;, event_datetime &lt;dttm&gt;,</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># event_age &lt;dbl&gt;, event_type &lt;chr&gt;, new_event_complete &lt;chr&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>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 24 × 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> record_id data <span style="color: #BB0000;">NA</span> text record_id </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> cpr data <span style="color: #BB0000;">NA</span> text cpr </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> inclusion data <span style="color: #BB0000;">NA</span> text inclusion </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> inclusion_time data <span style="color: #BB0000;">NA</span> text inclusion_time</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> dob data <span style="color: #BB0000;">NA</span> text dob </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</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;"> 7</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: #BCBCBC;"> 8</span> sex data <span style="color: #BB0000;">NA</span> text sex </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> cohabitation data <span style="color: #BB0000;">NA</span> text cohabitation </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> hypertension data <span style="color: #BB0000;">NA</span> text hypertension </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># 14 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;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>
<span class="r-out co"><span class="r-pr">#&gt;</span> attr(,"class")</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "REDCapCAST" "list" </span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co">## Adding a record_id field</span></span></span>
<span class="r-in"><span><span class="va">iris</span> <span class="op">|&gt;</span> <span class="fu">ds2dd_detailed</span><span class="op">(</span>add.auto.id <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span> <span class="r-in"><span><span class="va">iris</span> <span class="op">|&gt;</span> <span class="fu">ds2dd_detailed</span><span class="op">(</span>add.auto.id <span class="op">=</span> <span class="cn">TRUE</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: 150 × 6</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> record_id sepal.length sepal.width petal.length petal.width species</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&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>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 1 5.1 3.5 1.4 0.2 setosa </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 2 4.9 3 1.4 0.2 setosa </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 3 4.7 3.2 1.3 0.2 setosa </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 4 4.6 3.1 1.5 0.2 setosa </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 5 5 3.6 1.4 0.2 setosa </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 6 5.4 3.9 1.7 0.4 setosa </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 7 4.6 3.4 1.4 0.3 setosa </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 8 5 3.4 1.5 0.2 setosa </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 9 4.4 2.9 1.4 0.2 setosa </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 10 4.9 3.1 1.5 0.1 setosa </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># 140 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: 6 × 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> record_id data <span style="color: #BB0000;">NA</span> text record_id </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> sepal.length data <span style="color: #BB0000;">NA</span> text Sepal.Length</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> sepal.width data <span style="color: #BB0000;">NA</span> text Sepal.Width </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> petal.length data <span style="color: #BB0000;">NA</span> text Petal.Length</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">5</span> petal.width data <span style="color: #BB0000;">NA</span> text Petal.Width </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">6</span> species data <span style="color: #BB0000;">NA</span> radio Species </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>
<span class="r-out co"><span class="r-pr">#&gt;</span> attr(,"class")</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "REDCapCAST" "list" </span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co">## Passing form name information to function</span></span></span>
<span class="r-in"><span><span class="va">iris</span> <span class="op">|&gt;</span></span></span> <span class="r-in"><span><span class="va">iris</span> <span class="op">|&gt;</span></span></span>
<span class="r-in"><span> <span class="fu">ds2dd_detailed</span><span class="op">(</span></span></span> <span class="r-in"><span> <span class="fu">ds2dd_detailed</span><span class="op">(</span></span></span>
<span class="r-in"><span> add.auto.id <span class="op">=</span> <span class="cn">TRUE</span>,</span></span> <span class="r-in"><span> add.auto.id <span class="op">=</span> <span class="cn">TRUE</span>,</span></span>
<span class="r-in"><span> form.name <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="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"b"</span>, <span class="st">"c"</span><span class="op">)</span>, size <span class="op">=</span> <span class="fl">6</span>, replace <span class="op">=</span> <span class="cn">TRUE</span>, prob <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/rep.html" class="external-link">rep</a></span><span class="op">(</span><span class="fl">.5</span>, <span class="fl">2</span><span class="op">)</span><span class="op">)</span></span></span> <span class="r-in"><span> form.name <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="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"b"</span>, <span class="st">"c"</span><span class="op">)</span>, size <span class="op">=</span> <span class="fl">6</span>, replace <span class="op">=</span> <span class="cn">TRUE</span>, prob <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/rep.html" class="external-link">rep</a></span><span class="op">(</span><span class="fl">.5</span>, <span class="fl">2</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span> <span class="op">)</span> <span class="op">|&gt;</span></span></span> <span class="r-in"><span> <span class="op">)</span> <span class="op">|&gt;</span></span></span>
<span class="r-in"><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">"meta"</span><span class="op">)</span></span></span> <span class="r-in"><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">"meta"</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 6 × 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> record_id b <span style="color: #BB0000;">NA</span> text record_id </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> sepal.length c <span style="color: #BB0000;">NA</span> text Sepal.Length</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> sepal.width b <span style="color: #BB0000;">NA</span> text Sepal.Width </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> petal.length c <span style="color: #BB0000;">NA</span> text Petal.Length</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">5</span> petal.width b <span style="color: #BB0000;">NA</span> text Petal.Width </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">6</span> species c <span style="color: #BB0000;">NA</span> radio Species </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-in"><span><span class="va">mtcars</span> <span class="op">|&gt;</span> <span class="fu">ds2dd_detailed</span><span class="op">(</span>add.auto.id <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span> <span class="r-in"><span><span class="va">mtcars</span> <span class="op">|&gt;</span> <span class="fu">ds2dd_detailed</span><span class="op">(</span>add.auto.id <span class="op">=</span> <span class="cn">TRUE</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 × 12</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> record_id 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;int&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;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;dbl&gt;</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 1 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> 2 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> 3 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> 4 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> 5 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> 6 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> 7 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> 8 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> 9 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> 10 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: 12 × 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> record_id data <span style="color: #BB0000;">NA</span> text record_id </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> mpg data <span style="color: #BB0000;">NA</span> text mpg </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> cyl data <span style="color: #BB0000;">NA</span> text cyl </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</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;"> 5</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;"> 6</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;"> 7</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;"> 8</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;"> 9</span> vs data <span style="color: #BB0000;">NA</span> text vs </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> am data <span style="color: #BB0000;">NA</span> text am </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">11</span> gear data <span style="color: #BB0000;">NA</span> text gear </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">12</span> carb data <span style="color: #BB0000;">NA</span> text 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;lgl&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>
<span class="r-out co"><span class="r-pr">#&gt;</span> attr(,"class")</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "REDCapCAST" "list" </span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co">## Using column name suffix to carry form name</span></span></span>
<span class="r-in"><span><span class="va">data</span> <span class="op">&lt;-</span> <span class="va">iris</span> <span class="op">|&gt;</span></span></span> <span class="r-in"><span><span class="va">data</span> <span class="op">&lt;-</span> <span class="va">iris</span> <span class="op">|&gt;</span></span></span>
<span class="r-in"><span> <span class="fu">ds2dd_detailed</span><span class="op">(</span>add.auto.id <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> <span class="op">|&gt;</span></span></span> <span class="r-in"><span> <span class="fu">ds2dd_detailed</span><span class="op">(</span>add.auto.id <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span> <span class="op">|&gt;</span></span></span>
<span class="r-in"><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></span> <span class="r-in"><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></span>
<span class="r-in"><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="va">data</span><span class="op">)</span> <span class="op">&lt;-</span> <span class="fu">glue</span><span class="fu">::</span><span class="fu"><a href="https://glue.tidyverse.org/reference/glue.html" class="external-link">glue</a></span><span class="op">(</span><span class="st">"{sample(x = c('a','b'),size = length(names(data)),</span></span></span> <span class="r-in"><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="va">data</span><span class="op">)</span> <span class="op">&lt;-</span> <span class="fu">glue</span><span class="fu">::</span><span class="fu"><a href="https://glue.tidyverse.org/reference/glue.html" class="external-link">glue</a></span><span class="op">(</span><span class="st">"{sample(x = c('a','b'),size = length(names(data)),</span></span></span>
<span class="r-in"><span><span class="st">replace=TRUE,prob = rep(x=.5,2))}__{names(data)}"</span><span class="op">)</span></span></span> <span class="r-in"><span><span class="st">replace=TRUE,prob = rep(x=.5,2))}__{names(data)}"</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">data</span> <span class="op">|&gt;</span> <span class="fu">ds2dd_detailed</span><span class="op">(</span>form.sep <span class="op">=</span> <span class="st">"__"</span><span class="op">)</span></span></span> <span class="r-in"><span><span class="va">data</span> <span class="op">|&gt;</span> <span class="fu">ds2dd_detailed</span><span class="op">(</span>form.sep <span class="op">=</span> <span class="st">"__"</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">#&gt;</span> $data</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># A tibble: 150 × 6</span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> record_id sepal.length sepal.width petal.length petal.width species</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494; font-style: italic;">&lt;int&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>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 1</span> 1 5.1 3.5 1.4 0.2 setosa </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 2</span> 2 4.9 3 1.4 0.2 setosa </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 3</span> 3 4.7 3.2 1.3 0.2 setosa </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 4</span> 4 4.6 3.1 1.5 0.2 setosa </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 5</span> 5 5 3.6 1.4 0.2 setosa </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 6</span> 6 5.4 3.9 1.7 0.4 setosa </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 7</span> 7 4.6 3.4 1.4 0.3 setosa </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 8</span> 8 5 3.4 1.5 0.2 setosa </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;"> 9</span> 9 4.4 2.9 1.4 0.2 setosa </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">10</span> 10 4.9 3.1 1.5 0.1 setosa </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #949494;"># 140 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: 6 × 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> record_id a <span style="color: #BB0000;">NA</span> text record_id </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">2</span> sepal.length a <span style="color: #BB0000;">NA</span> text sepal.length</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">3</span> sepal.width a <span style="color: #BB0000;">NA</span> text sepal.width </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">4</span> petal.length b <span style="color: #BB0000;">NA</span> text petal.length</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">5</span> petal.width b <span style="color: #BB0000;">NA</span> text petal.width </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> <span style="color: #BCBCBC;">6</span> species b <span style="color: #BB0000;">NA</span> radio species </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>
<span class="r-out co"><span class="r-pr">#&gt;</span> attr(,"class")</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "REDCapCAST" "list" </span>
</code></pre></div> </code></pre></div>
</div> </div>
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2> </main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>

View File

@ -93,14 +93,14 @@
<span class="r-in"><span></span></span> <span class="r-in"><span></span></span>
<span class="r-in"><span><span class="va">v</span> <span class="op">&lt;-</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">|&gt;</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="va">v</span> <span class="op">&lt;-</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">|&gt;</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-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">#&gt;</span> structure(c(2L, 4L, 7L, 3L, 3L, 6L, 10L, 1L, 11L, 5L, 8L, 11L, </span> <span class="r-out co"><span class="r-pr">#&gt;</span> structure(c(10L, 9L, 3L, 2L, 6L, 9L, 3L, 5L, 4L, 9L, 1L, 6L, </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 8L, 3L, 3L, 9L, 10L, 1L, 4L, 2L), levels = c("7", "9", "10", </span> <span class="r-out co"><span class="r-pr">#&gt;</span> 5L, 5L, 3L, 8L, 2L, 7L, 1L, 11L), levels = c("6", "7", "8", "9", </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> "11", "12", "13", "14", "16", "17", "18", "19"), class = "factor")</span> <span class="r-out co"><span class="r-pr">#&gt;</span> "11", "12", "13", "14", "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-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">#&gt;</span> 9 11 14 10 13 18 7 19 12 16 17 </span> <span class="r-out co"><span class="r-pr">#&gt;</span> 16 15 8 7 12 11 9 6 14 13 17 </span>
<span class="r-out co"><span class="r-pr">#&gt;</span> 2 4 7 3 6 10 1 11 5 8 9 </span> <span class="r-out co"><span class="r-pr">#&gt;</span> 10 9 3 2 6 5 4 1 8 7 11 </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-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">#&gt;</span> [1] 9 11 14 10 10 13 18 7 19 12 16 19 16 10 10 17 18 7 11 9</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [1] 16 15 8 7 12 15 8 11 9 15 6 12 11 11 8 14 7 13 6 17</span>
</code></pre></div> </code></pre></div>
</div> </div>
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2> </main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>

View File

@ -55,6 +55,12 @@
<dd>Split REDCap repeating instruments table into multiple tables</dd> <dd>Split REDCap repeating instruments table into multiple tables</dd>
</dl><dl><dt> </dl><dl><dt>
<code><a href="all_na.html">all_na()</a></code>
</dt>
<dd>Check if vector is all NA</dd>
</dl><dl><dt>
<code><a href="as_factor.html">as_factor()</a></code> <code><a href="as_factor.html">as_factor()</a></code>
</dt> </dt>
@ -97,6 +103,12 @@
<dd>clean_redcap_name</dd> <dd>clean_redcap_name</dd>
</dl><dl><dt> </dl><dl><dt>
<code><a href="compact_vec.html">compact_vec()</a></code>
</dt>
<dd>Compacting a vector of any length with or without names</dd>
</dl><dl><dt>
<code><a href="create_html_table.html">create_html_table()</a></code> <code><a href="create_html_table.html">create_html_table()</a></code>
</dt> </dt>
@ -271,6 +283,12 @@
<dd>Helper to auto-parse un-formatted data with haven and readr</dd> <dd>Helper to auto-parse un-formatted data with haven and readr</dd>
</dl><dl><dt> </dl><dl><dt>
<code><a href="possibly_roman.html">possibly_roman()</a></code>
</dt>
<dd>Test if vector can be interpreted as roman numerals</dd>
</dl><dl><dt>
<code><a href="process_user_input.html">process_user_input()</a></code> <code><a href="process_user_input.html">process_user_input()</a></code>
</dt> </dt>
@ -383,6 +401,12 @@
</dt> </dt>
<dd>Convert vector to factor based on threshold of number of unique levels</dd> <dd>Convert vector to factor based on threshold of number of unique levels</dd>
</dl><dl><dt>
<code><a href="vec2choice.html">vec2choice()</a></code>
</dt>
<dd>Named vector to REDCap choices (`wrapping compact_vec()`)</dd>
</dl></div> </dl></div>
</main></div> </main></div>

View File

@ -89,11 +89,21 @@
<div class="section level2"> <div class="section level2">
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2> <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> <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="va">mtcars</span> <span class="op">|&gt;</span></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">parse_data</span><span class="op">(</span><span class="op">)</span> <span class="op">|&gt;</span></span></span> <span class="r-in"><span> <span class="fu">parse_data</span><span class="op">(</span><span class="op">)</span> <span class="op">|&gt;</span></span></span>
<span class="r-in"><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="r-in"><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="r-in"><span><span class="op">}</span> <span class="co"># }</span></span></span> <span class="r-out co"><span class="r-pr">#&gt;</span> 'data.frame': 32 obs. of 11 variables:</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $ mpg : num 21 21 22.8 21.4 18.7 18.1 14.3 24.4 22.8 19.2 ...</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $ cyl : num 6 6 4 6 8 6 8 4 4 6 ...</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $ disp: num 160 160 108 258 360 ...</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $ hp : num 110 110 93 110 175 105 245 62 95 123 ...</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $ drat: num 3.9 3.9 3.85 3.08 3.15 2.76 3.21 3.69 3.92 3.92 ...</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $ wt : num 2.62 2.88 2.32 3.21 3.44 ...</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $ qsec: num 16.5 17 18.6 19.4 17 ...</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $ vs : num 0 0 1 1 0 1 0 1 1 1 ...</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $ am : num 1 1 1 0 0 0 0 0 0 0 ...</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $ gear: num 4 4 4 3 3 3 3 4 4 4 ...</span>
<span class="r-out co"><span class="r-pr">#&gt;</span> $ carb: num 4 4 1 1 2 1 4 2 2 4 ...</span>
</code></pre></div> </code></pre></div>
</div> </div>
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2> </main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>

View File

@ -0,0 +1,92 @@
<!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>Test if vector can be interpreted as roman numerals — possibly_roman • 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="Test if vector can be interpreted as roman numerals — possibly_roman"><meta name="description" content="Test if vector can be interpreted as roman numerals"><meta property="og:description" content="Test if vector can be interpreted as roman numerals"><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>Test if vector can be interpreted as roman numerals</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_roman.Rd</code></div>
</div>
<div class="ref-description section level2">
<p>Test if vector can be interpreted as roman numerals</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_roman</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>character 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/sample.html" class="external-link">sample</a></span><span class="op">(</span><span class="fl">1</span><span class="op">:</span><span class="fl">100</span>,<span class="fl">10</span><span class="op">)</span> <span class="op">|&gt;</span> <span class="fu"><a href="https://rdrr.io/r/utils/roman.html" class="external-link">as.roman</a></span><span class="op">(</span><span class="op">)</span> <span class="op">|&gt;</span> <span class="fu">possibly_roman</span><span class="op">(</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] TRUE</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="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="cn">TRUE</span>,<span class="cn">FALSE</span><span class="op">)</span>,<span class="fl">10</span>,<span class="cn">TRUE</span><span class="op">)</span><span class="op">|&gt;</span> <span class="fu">possibly_roman</span><span class="op">(</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] FALSE</span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/rep.html" class="external-link">rep</a></span><span class="op">(</span><span class="cn">NA</span>,<span class="fl">10</span><span class="op">)</span><span class="op">|&gt;</span> <span class="fu">possibly_roman</span><span class="op">(</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</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>

View File

@ -69,15 +69,20 @@ factoring, but levels character vectors in order of appearance.</p>
<div class="section level2"> <div class="section level2">
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2> <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> <div class="sourceCode"><pre class="sourceCode r"><code><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="fu"><a href="https://rdrr.io/r/base/seq.html" class="external-link">seq_len</a></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">|&gt;</span></span></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="fu"><a href="https://rdrr.io/r/base/seq.html" class="external-link">seq_len</a></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">|&gt;</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">|&gt;</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">|&gt;</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-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">#&gt;</span> 1 2 3 4 </span>
<span class="r-out co"><span class="r-pr">#&gt;</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">|&gt;</span></span></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">|&gt;</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">|&gt;</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">|&gt;</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-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">#&gt;</span> Length Class Mode </span>
<span class="r-out co"><span class="r-pr">#&gt;</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">|&gt;</span> <span class="fu">var2fct</span><span class="op">(</span><span class="fl">6</span><span class="op">)</span></span></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">|&gt;</span> <span class="fu">var2fct</span><span class="op">(</span><span class="fl">6</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-wrn co"><span class="r-pr">#&gt;</span> <span class="warning">Warning: </span>invalid roman numerals: a a b b b a b b a</span>
<span class="r-out co"><span class="r-pr">#&gt;</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">#&gt;</span> Levels: a c b d</span>
</code></pre></div> </code></pre></div>
</div> </div>
</main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2> </main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>

92
reference/vec2choice.html Normal file
View File

@ -0,0 +1,92 @@
<!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>Named vector to REDCap choices (`wrapping compact_vec()`) — vec2choice • 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="Named vector to REDCap choices (`wrapping compact_vec()`) — vec2choice"><meta name="description" content="Named vector to REDCap choices (`wrapping compact_vec()`)"><meta property="og:description" content="Named vector to REDCap choices (`wrapping compact_vec()`)"><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>Named vector to REDCap choices (`wrapping compact_vec()`)</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>vec2choice.Rd</code></div>
</div>
<div class="ref-description section level2">
<p>Named vector to REDCap choices (`wrapping compact_vec()`)</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">vec2choice</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>named vector</p></dd>
</dl></div>
<div class="section level2">
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
<p>character string</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/sample.html" class="external-link">sample</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/seq.html" class="external-link">seq_len</a></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">|&gt;</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">|&gt;</span></span></span>
<span class="r-in"><span> <span class="fu"><a href="named_levels.html">named_levels</a></span><span class="op">(</span><span class="op">)</span> <span class="op">|&gt;</span></span></span>
<span class="r-in"><span> <span class="fu"><a href="https://rdrr.io/r/base/sort.html" class="external-link">sort</a></span><span class="op">(</span><span class="op">)</span> <span class="op">|&gt;</span></span></span>
<span class="r-in"><span> <span class="fu">vec2choice</span><span class="op">(</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] "1, 1 | 2, 2 | 3, 3 | 4, 4"</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>

File diff suppressed because one or more lines are too long

View File

@ -11,6 +11,7 @@
<url><loc>https://agdamsbo.github.io/REDCapCAST/news/index.html</loc></url> <url><loc>https://agdamsbo.github.io/REDCapCAST/news/index.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/REDCapCAST-package.html</loc></url> <url><loc>https://agdamsbo.github.io/REDCapCAST/reference/REDCapCAST-package.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/REDCap_split.html</loc></url> <url><loc>https://agdamsbo.github.io/REDCapCAST/reference/REDCap_split.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/all_na.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/as_factor.html</loc></url> <url><loc>https://agdamsbo.github.io/REDCapCAST/reference/as_factor.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/case_match_regex_list.html</loc></url> <url><loc>https://agdamsbo.github.io/REDCapCAST/reference/case_match_regex_list.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/cast_data_overview.html</loc></url> <url><loc>https://agdamsbo.github.io/REDCapCAST/reference/cast_data_overview.html</loc></url>
@ -18,6 +19,7 @@
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/char2choice.html</loc></url> <url><loc>https://agdamsbo.github.io/REDCapCAST/reference/char2choice.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/char2cond.html</loc></url> <url><loc>https://agdamsbo.github.io/REDCapCAST/reference/char2cond.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/clean_redcap_name.html</loc></url> <url><loc>https://agdamsbo.github.io/REDCapCAST/reference/clean_redcap_name.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/compact_vec.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/create_html_table.html</loc></url> <url><loc>https://agdamsbo.github.io/REDCapCAST/reference/create_html_table.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/create_instrument_meta.html</loc></url> <url><loc>https://agdamsbo.github.io/REDCapCAST/reference/create_instrument_meta.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/d2w.html</loc></url> <url><loc>https://agdamsbo.github.io/REDCapCAST/reference/d2w.html</loc></url>
@ -48,6 +50,7 @@
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/nav_bar_page.html</loc></url> <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/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/parse_data.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.character.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.data.frame.html</loc></url> <url><loc>https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.data.frame.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.default.html</loc></url> <url><loc>https://agdamsbo.github.io/REDCapCAST/reference/process_user_input.default.html</loc></url>
@ -67,5 +70,6 @@
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/strsplitx.html</loc></url> <url><loc>https://agdamsbo.github.io/REDCapCAST/reference/strsplitx.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/time_only_correction.html</loc></url> <url><loc>https://agdamsbo.github.io/REDCapCAST/reference/time_only_correction.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/var2fct.html</loc></url> <url><loc>https://agdamsbo.github.io/REDCapCAST/reference/var2fct.html</loc></url>
<url><loc>https://agdamsbo.github.io/REDCapCAST/reference/vec2choice.html</loc></url>
</urlset> </urlset>