mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 09:51:48 +02:00
(v1.4.0.9001) is_gram_positive(), is_gram_negative(), parameter hardening
This commit is contained in:
@ -50,7 +50,7 @@
|
||||
|
||||
<meta property="og:title" content="Deprecated functions — AMR-deprecated" />
|
||||
<meta property="og:description" content="These functions are so-called 'Deprecated'. They will be removed in a future release. Using the functions will give a warning with the name of the function it has been replaced by (if there is one)." />
|
||||
<meta property="og:image" content="https://msberends.github.io/AMR/logo.svg" />
|
||||
<meta property="og:image" content="https://msberends.github.io/AMR/logo.png" />
|
||||
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.3.0.9015</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9001</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -242,17 +242,7 @@
|
||||
<p>These functions are so-called '<a href='https://rdrr.io/r/base/Deprecated.html'>Deprecated</a>'. They will be removed in a future release. Using the functions will give a warning with the name of the function it has been replaced by (if there is one).</p>
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>portion_R</span>(<span class='kw'>...</span>)
|
||||
|
||||
<span class='fu'>portion_IR</span>(<span class='kw'>...</span>)
|
||||
|
||||
<span class='fu'>portion_I</span>(<span class='kw'>...</span>)
|
||||
|
||||
<span class='fu'>portion_SI</span>(<span class='kw'>...</span>)
|
||||
|
||||
<span class='fu'>portion_S</span>(<span class='kw'>...</span>)
|
||||
|
||||
<span class='fu'>portion_df</span>(<span class='kw'>...</span>)</pre>
|
||||
<pre class="usage"><span class='fu'>p_symbol</span><span class='op'>(</span><span class='va'>p</span>, emptychar <span class='op'>=</span> <span class='st'>" "</span><span class='op'>)</span></pre>
|
||||
|
||||
|
||||
<h2 class="hasAnchor" id="retired-lifecycle"><a class="anchor" href="#retired-lifecycle"></a>Retired lifecycle</h2>
|
||||
@ -265,7 +255,7 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>retired</
|
||||
|
||||
|
||||
|
||||
<p>On our website <a href='https://msberends.github.io/AMR'>https://msberends.github.io/AMR</a> you can find <a href='https://msberends.github.io/AMR/articles/AMR.html'>a comprehensive tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.github.io/AMR/reference'>complete documentation of all functions</a> (which reads a lot easier than here in R) and <a href='https://msberends.github.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>. As we would like to better understand the backgrounds and needs of our users, please <a href='https://msberends.github.io/AMR/survey.html'>participate in our survey</a>!</p>
|
||||
<p>On our website <a href='https://msberends.github.io/AMR/'>https://msberends.github.io/AMR/</a> you can find <a href='https://msberends.github.io/AMR/articles/AMR.html'>a comprehensive tutorial</a> about how to conduct AMR analysis, the <a href='https://msberends.github.io/AMR/reference/'>complete documentation of all functions</a> and <a href='https://msberends.github.io/AMR/articles/WHONET.html'>an example analysis using WHONET data</a>. As we would like to better understand the backgrounds and needs of our users, please <a href='https://msberends.github.io/AMR/survey.html'>participate in our survey</a>!</p>
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
|
||||
@ -282,7 +272,7 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>retired</
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.9000.</p>
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
|
||||
</div>
|
||||
|
||||
</footer>
|
||||
|
@ -82,7 +82,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9000</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9001</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -242,7 +242,7 @@
|
||||
<p>Calculates age in years based on a reference date, which is the sytem date at default.</p>
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>age</span><span class='op'>(</span><span class='va'>x</span>, reference <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/Sys.time.html'>Sys.Date</a></span><span class='op'>(</span><span class='op'>)</span>, exact <span class='op'>=</span> <span class='cn'>FALSE</span>, na.rm <span class='op'>=</span> <span class='cn'>FALSE</span><span class='op'>)</span></pre>
|
||||
<pre class="usage"><span class='fu'>age</span><span class='op'>(</span><span class='va'>x</span>, reference <span class='op'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/Sys.time.html'>Sys.Date</a></span><span class='op'>(</span><span class='op'>)</span>, exact <span class='op'>=</span> <span class='cn'>FALSE</span>, na.rm <span class='op'>=</span> <span class='cn'>FALSE</span>, <span class='va'>...</span><span class='op'>)</span></pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
@ -253,7 +253,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th>reference</th>
|
||||
<td><p>reference date(s) (defaults to today), will be coerced with <code><a href='https://rdrr.io/r/base/as.POSIXlt.html'>as.POSIXlt()</a></code> and cannot be lower than <code>x</code></p></td>
|
||||
<td><p>reference date(s) (defaults to today), will be coerced with <code><a href='https://rdrr.io/r/base/as.POSIXlt.html'>as.POSIXlt()</a></code></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>exact</th>
|
||||
@ -263,11 +263,18 @@
|
||||
<th>na.rm</th>
|
||||
<td><p>a logical to indicate whether missing values should be removed</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>parameters passed on to <code><a href='https://rdrr.io/r/base/as.POSIXlt.html'>as.POSIXlt()</a></code>, such as <code>origin</code></p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>An <a href='https://rdrr.io/r/base/integer.html'>integer</a> (no decimals) if <code>exact = FALSE</code>, a <a href='https://rdrr.io/r/base/double.html'>double</a> (with decimals) otherwise</p>
|
||||
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
||||
|
||||
<p>Ages below 0 will be returned as <code>NA</code> with a warning. Ages above 120 will only give a warning.</p>
|
||||
<h2 class="hasAnchor" id="stable-lifecycle"><a class="anchor" href="#stable-lifecycle"></a>Stable lifecycle</h2>
|
||||
|
||||
|
||||
|
@ -82,7 +82,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9000</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9001</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -267,13 +267,13 @@
|
||||
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
||||
|
||||
<p>To split ages, the input for the <code>split_at</code> parameter can be:</p><ul>
|
||||
<li><p>A numeric vector. A vector of e.g. <code><a href='https://rdrr.io/r/base/c.html'>c(10, 20)</a></code> will split on 0-9, 10-19 and 20+. A value of only <code>50</code> will split on 0-49 and 50+.
|
||||
<li><p>A numeric vector. A value of e.g. <code><a href='https://rdrr.io/r/base/c.html'>c(10, 20)</a></code> will split <code>x</code> on 0-9, 10-19 and 20+. A value of only <code>50</code> will split <code>x</code> on 0-49 and 50+.
|
||||
The default is to split on young children (0-11), youth (12-24), young adults (25-54), middle-aged adults (55-74) and elderly (75+).</p></li>
|
||||
<li><p>A character:</p><ul>
|
||||
<li><p><code>"children"</code> or <code>"kids"</code>, equivalent of: <code><a href='https://rdrr.io/r/base/c.html'>c(0, 1, 2, 4, 6, 13, 18)</a></code>. This will split on 0, 1, 2-3, 4-5, 6-12, 13-17 and 18+.</p></li>
|
||||
<li><p><code>"elderly"</code> or <code>"seniors"</code>, equivalent of: <code><a href='https://rdrr.io/r/base/c.html'>c(65, 75, 85)</a></code>. This will split on 0-64, 65-74, 75-84, 85+.</p></li>
|
||||
<li><p><code>"fives"</code>, equivalent of: <code>1:20 * 5</code>. This will split on 0-4, 5-9, 10-14, ..., 90-94, 95-99, 100+.</p></li>
|
||||
<li><p><code>"tens"</code>, equivalent of: <code>1:10 * 10</code>. This will split on 0-9, 10-19, 20-29, ..., 80-89, 90-99, 100+.</p></li>
|
||||
<li><p><code>"fives"</code>, equivalent of: <code>1:20 * 5</code>. This will split on 0-4, 5-9, ..., 95-99, 100+.</p></li>
|
||||
<li><p><code>"tens"</code>, equivalent of: <code>1:10 * 10</code>. This will split on 0-9, 10-19, ..., 90-99, 100+.</p></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
|
||||
@ -311,12 +311,11 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>stable</s
|
||||
<span class='fu'>age_groups</span><span class='op'>(</span><span class='va'>ages</span>, split_at <span class='op'>=</span> <span class='st'>"fives"</span><span class='op'>)</span>
|
||||
|
||||
<span class='co'># split specifically for children</span>
|
||||
<span class='fu'>age_groups</span><span class='op'>(</span><span class='va'>ages</span>, <span class='st'>"children"</span><span class='op'>)</span>
|
||||
<span class='co'># same:</span>
|
||||
<span class='fu'>age_groups</span><span class='op'>(</span><span class='va'>ages</span>, <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></span><span class='op'>(</span><span class='fl'>1</span>, <span class='fl'>2</span>, <span class='fl'>4</span>, <span class='fl'>6</span>, <span class='fl'>13</span>, <span class='fl'>17</span><span class='op'>)</span><span class='op'>)</span>
|
||||
<span class='fu'>age_groups</span><span class='op'>(</span><span class='va'>ages</span>, <span class='st'>"children"</span><span class='op'>)</span>
|
||||
|
||||
<span class='co'># \donttest{</span>
|
||||
<span class='co'># resistance of ciprofloxacine per age group</span>
|
||||
<span class='co'># resistance of ciprofloxacin per age group</span>
|
||||
<span class='kw'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='op'>(</span><span class='va'><a href='https://dplyr.tidyverse.org'>dplyr</a></span><span class='op'>)</span>
|
||||
<span class='va'>example_isolates</span> <span class='op'>%>%</span>
|
||||
<span class='fu'><a href='first_isolate.html'>filter_first_isolate</a></span><span class='op'>(</span><span class='op'>)</span> <span class='op'>%>%</span>
|
||||
|
@ -82,7 +82,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9000</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9001</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -315,7 +315,7 @@
|
||||
|
||||
<span class='co'># get bug/drug combinations for only macrolides in Gram-positives:</span>
|
||||
<span class='va'>example_isolates</span> <span class='op'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span><span class='op'>(</span><span class='fu'><a href='mo_property.html'>mo_gramstain</a></span><span class='op'>(</span><span class='va'>mo</span><span class='op'>)</span> <span class='op'>%like%</span> <span class='st'>"pos"</span><span class='op'>)</span> <span class='op'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span><span class='op'>(</span><span class='va'>mo</span> <span class='op'>%>%</span> <span class='fu'><a href='mo_property.html'>is_gram_positive</a></span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span> <span class='op'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span><span class='op'>(</span><span class='va'>mo</span>, <span class='fu'>macrolides</span><span class='op'>(</span><span class='op'>)</span><span class='op'>)</span> <span class='op'>%>%</span>
|
||||
<span class='fu'><a href='bug_drug_combinations.html'>bug_drug_combinations</a></span><span class='op'>(</span><span class='op'>)</span> <span class='op'>%>%</span>
|
||||
<span class='fu'><a href='https://rdrr.io/r/base/format.html'>format</a></span><span class='op'>(</span><span class='op'>)</span>
|
||||
|
@ -82,7 +82,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9000</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9001</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -311,7 +311,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th>uti</th>
|
||||
<td><p>(Urinary Tract Infection) A vector with <a href='https://rdrr.io/r/base/logical.html'>logical</a>s (<code>TRUE</code> or <code>FALSE</code>) to specify whether a UTI specific interpretation from the guideline should be chosen. For using <code>as.rsi()</code> on a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a>, this can also be a column containing <a href='https://rdrr.io/r/base/logical.html'>logical</a>s or when left blank, the data set will be search for a 'specimen' and rows containing 'urin' in that column will be regarded isolates from a UTI. See <em>Examples</em>.</p></td>
|
||||
<td><p>(Urinary Tract Infection) A vector with <a href='https://rdrr.io/r/base/logical.html'>logical</a>s (<code>TRUE</code> or <code>FALSE</code>) to specify whether a UTI specific interpretation from the guideline should be chosen. For using <code>as.rsi()</code> on a <a href='https://rdrr.io/r/base/data.frame.html'>data.frame</a>, this can also be a column containing <a href='https://rdrr.io/r/base/logical.html'>logical</a>s or when left blank, the data set will be searched for a 'specimen' and rows containing 'urin' (such as 'urine', 'urina') in that column will be regarded isolates from a UTI. See <em>Examples</em>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>conserve_capped_values</th>
|
||||
|
@ -82,7 +82,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9000</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9001</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -272,7 +272,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th>FUN</th>
|
||||
<td><p>the function to call on the <code>mo</code> column to transform the microorganism IDs, defaults to <code><a href='mo_property.html'>mo_shortname()</a></code></p></td>
|
||||
<td><p>function to call on the <code>mo</code> column to transform the microorganism IDs, defaults to <code><a href='mo_property.html'>mo_shortname()</a></code></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
@ -280,7 +280,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th>translate_ab</th>
|
||||
<td><p>a character of length 1 containing column names of the <a href='antibiotics.html'>antibiotics</a> data set</p></td>
|
||||
<td><p>character of length 1 containing column names of the <a href='antibiotics.html'>antibiotics</a> data set</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>language</th>
|
||||
|
@ -82,7 +82,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9001</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -242,30 +242,30 @@
|
||||
<p>Produces a <code>ggplot2</code> variant of a so-called <a href='https://en.wikipedia.org/wiki/Biplot'>biplot</a> for PCA (principal component analysis), but is more flexible and more appealing than the base <span style="R">R</span> <code><a href='https://rdrr.io/r/stats/biplot.html'>biplot()</a></code> function.</p>
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ggplot_pca</span>(
|
||||
<span class='kw'>x</span>,
|
||||
choices = <span class='fl'>1</span><span class='op'>:</span><span class='fl'>2</span>,
|
||||
scale = <span class='fl'>TRUE</span>,
|
||||
pc.biplot = <span class='fl'>TRUE</span>,
|
||||
labels = <span class='kw'>NULL</span>,
|
||||
labels_textsize = <span class='fl'>3</span>,
|
||||
labels_text_placement = <span class='fl'>1.5</span>,
|
||||
groups = <span class='kw'>NULL</span>,
|
||||
ellipse = <span class='fl'>TRUE</span>,
|
||||
ellipse_prob = <span class='fl'>0.68</span>,
|
||||
ellipse_size = <span class='fl'>0.5</span>,
|
||||
ellipse_alpha = <span class='fl'>0.5</span>,
|
||||
points_size = <span class='fl'>2</span>,
|
||||
points_alpha = <span class='fl'>0.25</span>,
|
||||
arrows = <span class='fl'>TRUE</span>,
|
||||
arrows_colour = <span class='st'>"darkblue"</span>,
|
||||
arrows_size = <span class='fl'>0.5</span>,
|
||||
arrows_textsize = <span class='fl'>3</span>,
|
||||
arrows_textangled = <span class='fl'>TRUE</span>,
|
||||
arrows_alpha = <span class='fl'>0.75</span>,
|
||||
base_textsize = <span class='fl'>10</span>,
|
||||
<span class='kw'>...</span>
|
||||
)</pre>
|
||||
<pre class="usage"><span class='fu'>ggplot_pca</span><span class='op'>(</span>
|
||||
<span class='va'>x</span>,
|
||||
choices <span class='op'>=</span> <span class='fl'>1</span><span class='op'>:</span><span class='fl'>2</span>,
|
||||
scale <span class='op'>=</span> <span class='fl'>1</span>,
|
||||
pc.biplot <span class='op'>=</span> <span class='cn'>TRUE</span>,
|
||||
labels <span class='op'>=</span> <span class='cn'>NULL</span>,
|
||||
labels_textsize <span class='op'>=</span> <span class='fl'>3</span>,
|
||||
labels_text_placement <span class='op'>=</span> <span class='fl'>1.5</span>,
|
||||
groups <span class='op'>=</span> <span class='cn'>NULL</span>,
|
||||
ellipse <span class='op'>=</span> <span class='cn'>TRUE</span>,
|
||||
ellipse_prob <span class='op'>=</span> <span class='fl'>0.68</span>,
|
||||
ellipse_size <span class='op'>=</span> <span class='fl'>0.5</span>,
|
||||
ellipse_alpha <span class='op'>=</span> <span class='fl'>0.5</span>,
|
||||
points_size <span class='op'>=</span> <span class='fl'>2</span>,
|
||||
points_alpha <span class='op'>=</span> <span class='fl'>0.25</span>,
|
||||
arrows <span class='op'>=</span> <span class='cn'>TRUE</span>,
|
||||
arrows_colour <span class='op'>=</span> <span class='st'>"darkblue"</span>,
|
||||
arrows_size <span class='op'>=</span> <span class='fl'>0.5</span>,
|
||||
arrows_textsize <span class='op'>=</span> <span class='fl'>3</span>,
|
||||
arrows_textangled <span class='op'>=</span> <span class='cn'>TRUE</span>,
|
||||
arrows_alpha <span class='op'>=</span> <span class='fl'>0.75</span>,
|
||||
base_textsize <span class='op'>=</span> <span class='fl'>10</span>,
|
||||
<span class='va'>...</span>
|
||||
<span class='op'>)</span></pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
@ -375,8 +375,9 @@
|
||||
<p>As per their GPL-2 licence that demands documentation of code changes, the changes made based on the source code were:</p><ol>
|
||||
<li><p>Rewritten code to remove the dependency on packages <code>plyr</code>, <code>scales</code> and <code>grid</code></p></li>
|
||||
<li><p>Parametrised more options, like arrow and ellipse settings</p></li>
|
||||
<li><p>Hardened all input possibilities by defining the exact type of user input for every parameter</p></li>
|
||||
<li><p>Added total amount of explained variance as a caption in the plot</p></li>
|
||||
<li><p>Cleaned all syntax based on the <code>lintr</code> package and added integrity checks</p></li>
|
||||
<li><p>Cleaned all syntax based on the <code>lintr</code> package, fixed grammatical errors and added integrity checks</p></li>
|
||||
<li><p>Updated documentation</p></li>
|
||||
</ol>
|
||||
|
||||
@ -395,25 +396,25 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>maturing<
|
||||
<span class='co'># See ?example_isolates.</span>
|
||||
|
||||
<span class='co'># See ?pca for more info about Principal Component Analysis (PCA).</span>
|
||||
<span class='co'>if</span> (<span class='fu'><a href='https://rdrr.io/r/base/library.html'>require</a></span>(<span class='st'><a href='https://dplyr.tidyverse.org'>"dplyr"</a></span>)) {
|
||||
<span class='kw'>pca_model</span> <span class='op'><-</span> <span class='kw'>example_isolates</span> <span class='op'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span>(<span class='fu'><a href='mo_property.html'>mo_genus</a></span>(<span class='kw'>mo</span>) <span class='op'>==</span> <span class='st'>"Staphylococcus"</span>) <span class='op'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/group_by.html'>group_by</a></span>(species = <span class='fu'><a href='mo_property.html'>mo_shortname</a></span>(<span class='kw'>mo</span>)) <span class='op'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/summarise_all.html'>summarise_if</a></span> (<span class='kw'>is.rsi</span>, <span class='kw'>resistance</span>) <span class='op'>%>%</span>
|
||||
<span class='fu'><a href='pca.html'>pca</a></span>(<span class='kw'>FLC</span>, <span class='kw'>AMC</span>, <span class='kw'>CXM</span>, <span class='kw'>GEN</span>, <span class='kw'>TOB</span>, <span class='kw'>TMP</span>, <span class='kw'>SXT</span>, <span class='kw'>CIP</span>, <span class='kw'>TEC</span>, <span class='kw'>TCY</span>, <span class='kw'>ERY</span>)
|
||||
<span class='kw'>if</span> <span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='https://dplyr.tidyverse.org'>"dplyr"</a></span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span>
|
||||
<span class='va'>pca_model</span> <span class='op'><-</span> <span class='va'>example_isolates</span> <span class='op'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span><span class='op'>(</span><span class='fu'><a href='mo_property.html'>mo_genus</a></span><span class='op'>(</span><span class='va'>mo</span><span class='op'>)</span> <span class='op'>==</span> <span class='st'>"Staphylococcus"</span><span class='op'>)</span> <span class='op'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/group_by.html'>group_by</a></span><span class='op'>(</span>species <span class='op'>=</span> <span class='fu'><a href='mo_property.html'>mo_shortname</a></span><span class='op'>(</span><span class='va'>mo</span><span class='op'>)</span><span class='op'>)</span> <span class='op'>%>%</span>
|
||||
<span class='fu'><a href='https://dplyr.tidyverse.org/reference/summarise_all.html'>summarise_if</a></span> <span class='op'>(</span><span class='va'>is.rsi</span>, <span class='va'>resistance</span><span class='op'>)</span> <span class='op'>%>%</span>
|
||||
<span class='fu'><a href='pca.html'>pca</a></span><span class='op'>(</span><span class='va'>FLC</span>, <span class='va'>AMC</span>, <span class='va'>CXM</span>, <span class='va'>GEN</span>, <span class='va'>TOB</span>, <span class='va'>TMP</span>, <span class='va'>SXT</span>, <span class='va'>CIP</span>, <span class='va'>TEC</span>, <span class='va'>TCY</span>, <span class='va'>ERY</span><span class='op'>)</span>
|
||||
|
||||
<span class='co'># old (base R)</span>
|
||||
<span class='fu'><a href='https://rdrr.io/r/stats/biplot.html'>biplot</a></span>(<span class='kw'>pca_model</span>)
|
||||
<span class='fu'><a href='https://rdrr.io/r/stats/biplot.html'>biplot</a></span><span class='op'>(</span><span class='va'>pca_model</span><span class='op'>)</span>
|
||||
|
||||
<span class='co'># new </span>
|
||||
<span class='fu'>ggplot_pca</span>(<span class='kw'>pca_model</span>)
|
||||
<span class='fu'>ggplot_pca</span><span class='op'>(</span><span class='va'>pca_model</span><span class='op'>)</span>
|
||||
|
||||
<span class='co'>if</span> (<span class='fu'><a href='https://rdrr.io/r/base/library.html'>require</a></span>(<span class='st'><a href='http://ggplot2.tidyverse.org'>"ggplot2"</a></span>)) {
|
||||
<span class='fu'>ggplot_pca</span>(<span class='kw'>pca_model</span>) <span class='op'>+</span>
|
||||
<span class='fu'><a href='https://ggplot2.tidyverse.org/reference/scale_viridis.html'>scale_colour_viridis_d</a></span>() <span class='op'>+</span>
|
||||
<span class='fu'><a href='https://ggplot2.tidyverse.org/reference/labs.html'>labs</a></span>(title = <span class='st'>"Title here"</span>)
|
||||
}
|
||||
}
|
||||
<span class='kw'>if</span> <span class='op'>(</span><span class='kw'><a href='https://rdrr.io/r/base/library.html'>require</a></span><span class='op'>(</span><span class='st'><a href='http://ggplot2.tidyverse.org'>"ggplot2"</a></span><span class='op'>)</span><span class='op'>)</span> <span class='op'>{</span>
|
||||
<span class='fu'>ggplot_pca</span><span class='op'>(</span><span class='va'>pca_model</span><span class='op'>)</span> <span class='op'>+</span>
|
||||
<span class='fu'><a href='https://ggplot2.tidyverse.org/reference/scale_viridis.html'>scale_colour_viridis_d</a></span><span class='op'>(</span><span class='op'>)</span> <span class='op'>+</span>
|
||||
<span class='fu'><a href='https://ggplot2.tidyverse.org/reference/labs.html'>labs</a></span><span class='op'>(</span>title <span class='op'>=</span> <span class='st'>"Title here"</span><span class='op'>)</span>
|
||||
<span class='op'>}</span>
|
||||
<span class='op'>}</span>
|
||||
</pre>
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
|
||||
@ -430,7 +431,7 @@ The <a href='lifecycle.html'>lifecycle</a> of this function is <strong>maturing<
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.9000.</p>
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
|
||||
</div>
|
||||
|
||||
</footer>
|
||||
|
@ -82,7 +82,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9000</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9001</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -266,7 +266,7 @@
|
||||
<p>A column name of <code>x</code>, or <code>NULL</code> when no result is found.</p>
|
||||
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
|
||||
|
||||
<p>You can look for an antibiotic (trade) name or abbreviation and it will search <code>x</code> and the <a href='antibiotics.html'>antibiotics</a> data set for any column containing a name or code of that antibiotic. <strong>Longer columns names take precendence over shorter column names.</strong></p>
|
||||
<p>You can look for an antibiotic (trade) name or abbreviation and it will search <code>x</code> and the <a href='antibiotics.html'>antibiotics</a> data set for any column containing a name or code of that antibiotic. <strong>Longer columns names take precedence over shorter column names.</strong></p>
|
||||
<h2 class="hasAnchor" id="stable-lifecycle"><a class="anchor" href="#stable-lifecycle"></a>Stable lifecycle</h2>
|
||||
|
||||
|
||||
|
@ -81,7 +81,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9000</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9001</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -361,7 +361,7 @@
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="mo_property.html">mo_name()</a></code> <code><a href="mo_property.html">mo_fullname()</a></code> <code><a href="mo_property.html">mo_shortname()</a></code> <code><a href="mo_property.html">mo_subspecies()</a></code> <code><a href="mo_property.html">mo_species()</a></code> <code><a href="mo_property.html">mo_genus()</a></code> <code><a href="mo_property.html">mo_family()</a></code> <code><a href="mo_property.html">mo_order()</a></code> <code><a href="mo_property.html">mo_class()</a></code> <code><a href="mo_property.html">mo_phylum()</a></code> <code><a href="mo_property.html">mo_kingdom()</a></code> <code><a href="mo_property.html">mo_domain()</a></code> <code><a href="mo_property.html">mo_type()</a></code> <code><a href="mo_property.html">mo_gramstain()</a></code> <code><a href="mo_property.html">mo_snomed()</a></code> <code><a href="mo_property.html">mo_ref()</a></code> <code><a href="mo_property.html">mo_authors()</a></code> <code><a href="mo_property.html">mo_year()</a></code> <code><a href="mo_property.html">mo_rank()</a></code> <code><a href="mo_property.html">mo_taxonomy()</a></code> <code><a href="mo_property.html">mo_synonyms()</a></code> <code><a href="mo_property.html">mo_info()</a></code> <code><a href="mo_property.html">mo_url()</a></code> <code><a href="mo_property.html">mo_property()</a></code> </p>
|
||||
<p><code><a href="mo_property.html">mo_name()</a></code> <code><a href="mo_property.html">mo_fullname()</a></code> <code><a href="mo_property.html">mo_shortname()</a></code> <code><a href="mo_property.html">mo_subspecies()</a></code> <code><a href="mo_property.html">mo_species()</a></code> <code><a href="mo_property.html">mo_genus()</a></code> <code><a href="mo_property.html">mo_family()</a></code> <code><a href="mo_property.html">mo_order()</a></code> <code><a href="mo_property.html">mo_class()</a></code> <code><a href="mo_property.html">mo_phylum()</a></code> <code><a href="mo_property.html">mo_kingdom()</a></code> <code><a href="mo_property.html">mo_domain()</a></code> <code><a href="mo_property.html">mo_type()</a></code> <code><a href="mo_property.html">mo_gramstain()</a></code> <code><a href="mo_property.html">is_gram_negative()</a></code> <code><a href="mo_property.html">is_gram_positive()</a></code> <code><a href="mo_property.html">mo_snomed()</a></code> <code><a href="mo_property.html">mo_ref()</a></code> <code><a href="mo_property.html">mo_authors()</a></code> <code><a href="mo_property.html">mo_year()</a></code> <code><a href="mo_property.html">mo_rank()</a></code> <code><a href="mo_property.html">mo_taxonomy()</a></code> <code><a href="mo_property.html">mo_synonyms()</a></code> <code><a href="mo_property.html">mo_info()</a></code> <code><a href="mo_property.html">mo_url()</a></code> <code><a href="mo_property.html">mo_property()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Get properties of a microorganism</p></td>
|
||||
</tr><tr>
|
||||
@ -630,9 +630,9 @@
|
||||
</tr><tr>
|
||||
|
||||
<td>
|
||||
<p><code><a href="p_symbol.html">p_symbol()</a></code> </p>
|
||||
<p><code><a href="AMR-deprecated.html">p_symbol()</a></code> </p>
|
||||
</td>
|
||||
<td><p>Symbol of a p-value</p></td>
|
||||
<td><p>Deprecated functions</p></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -82,7 +82,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9000</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9001</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -281,7 +281,7 @@
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>x</th>
|
||||
<td><p>table with antibiotics coloms, like <code>AMX</code> or <code>amox</code></p></td>
|
||||
<td><p>a data.frame with antibiotics columns, like <code>AMX</code> or <code>amox</code></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>col_mo</th>
|
||||
@ -289,27 +289,27 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th>universal_1, universal_2, universal_3, universal_4, universal_5, universal_6</th>
|
||||
<td><p>column names of <strong>broad-spectrum</strong> antibiotics, case-insensitive. At default, the columns containing these antibiotics will be guessed with <code><a href='guess_ab_col.html'>guess_ab_col()</a></code>.</p></td>
|
||||
<td><p>column names of <strong>broad-spectrum</strong> antibiotics, case-insensitive. See details for which antibiotics will be used at default (which are guessed with <code><a href='guess_ab_col.html'>guess_ab_col()</a></code>).</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>GramPos_1, GramPos_2, GramPos_3, GramPos_4, GramPos_5, GramPos_6</th>
|
||||
<td><p>column names of antibiotics for <strong>Gram-positives</strong>, case-insensitive. At default, the columns containing these antibiotics will be guessed with <code><a href='guess_ab_col.html'>guess_ab_col()</a></code>.</p></td>
|
||||
<td><p>column names of antibiotics for <strong>Gram-positives</strong>, case-insensitive. See details for which antibiotics will be used at default (which are guessed with <code><a href='guess_ab_col.html'>guess_ab_col()</a></code>).</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>GramNeg_1, GramNeg_2, GramNeg_3, GramNeg_4, GramNeg_5, GramNeg_6</th>
|
||||
<td><p>column names of antibiotics for <strong>Gram-negatives</strong>, case-insensitive. At default, the columns containing these antibiotics will be guessed with <code><a href='guess_ab_col.html'>guess_ab_col()</a></code>.</p></td>
|
||||
<td><p>column names of antibiotics for <strong>Gram-negatives</strong>, case-insensitive. See details for which antibiotics will be used at default (which are guessed with <code><a href='guess_ab_col.html'>guess_ab_col()</a></code>).</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>warnings</th>
|
||||
<td><p>give warning about missing antibiotic columns, they will anyway be ignored</p></td>
|
||||
<td><p>give a warning about missing antibiotic columns (they will be ignored)</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>other parameters passed on to function</p></td>
|
||||
<td><p>other parameters passed on to functions</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>y, z</th>
|
||||
<td><p>characters to compare</p></td>
|
||||
<td><p>character vectors to compare</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>type</th>
|
||||
|
@ -82,7 +82,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9000</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9001</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@ -270,6 +270,10 @@
|
||||
|
||||
<span class='fu'>mo_gramstain</span><span class='op'>(</span><span class='va'>x</span>, language <span class='op'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span><span class='op'>(</span><span class='op'>)</span>, <span class='va'>...</span><span class='op'>)</span>
|
||||
|
||||
<span class='fu'>is_gram_negative</span><span class='op'>(</span><span class='va'>x</span>, <span class='va'>...</span><span class='op'>)</span>
|
||||
|
||||
<span class='fu'>is_gram_positive</span><span class='op'>(</span><span class='va'>x</span>, <span class='va'>...</span><span class='op'>)</span>
|
||||
|
||||
<span class='fu'>mo_snomed</span><span class='op'>(</span><span class='va'>x</span>, language <span class='op'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span><span class='op'>(</span><span class='op'>)</span>, <span class='va'>...</span><span class='op'>)</span>
|
||||
|
||||
<span class='fu'>mo_ref</span><span class='op'>(</span><span class='va'>x</span>, language <span class='op'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span><span class='op'>(</span><span class='op'>)</span>, <span class='va'>...</span><span class='op'>)</span>
|
||||
@ -295,7 +299,7 @@
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>x</th>
|
||||
<td><p>any (vector of) text that can be coerced to a valid microorganism code with <code><a href='as.mo.html'>as.mo()</a></code></p></td>
|
||||
<td><p>any character (vector) that can be coerced to a valid microorganism code with <code><a href='as.mo.html'>as.mo()</a></code></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>language</th>
|
||||
@ -336,7 +340,7 @@
|
||||
|
||||
<p>The short name - <code>mo_shortname()</code> - almost always returns the first character of the genus and the full species, like <code>"E. coli"</code>. Exceptions are abbreviations of staphylococci (like <em>"CoNS"</em>, Coagulase-Negative Staphylococci) and beta-haemolytic streptococci (like <em>"GBS"</em>, Group B Streptococci). Please bear in mind that e.g. <em>E. coli</em> could mean <em>Escherichia coli</em> (kingdom of Bacteria) as well as <em>Entamoeba coli</em> (kingdom of Protozoa). Returning to the full name will be done using <code><a href='as.mo.html'>as.mo()</a></code> internally, giving priority to bacteria and human pathogens, i.e. <code>"E. coli"</code> will be considered <em>Escherichia coli</em>. In other words, <code>mo_fullname(mo_shortname("Entamoeba coli"))</code> returns <code>"Escherichia coli"</code>.</p>
|
||||
<p>Since the top-level of the taxonomy is sometimes referred to as 'kingdom' and sometimes as 'domain', the functions <code>mo_kingdom()</code> and <code>mo_domain()</code> return the exact same results.</p>
|
||||
<p>The Gram stain - <code>mo_gramstain()</code> - will be determined based on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002, <a href='https://pubmed.ncbi.nlm.nih.gov/11837318'>PMID 11837318</a>), who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes. These bacteria are considered Gram-positive - all other bacteria are considered Gram-negative. Species outside the kingdom of Bacteria will return a value <code>NA</code>.</p>
|
||||
<p>The Gram stain - <code>mo_gramstain()</code> - will be determined based on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002, <a href='https://pubmed.ncbi.nlm.nih.gov/11837318'>PMID 11837318</a>), who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes. These bacteria are considered Gram-positive - all other bacteria are considered Gram-negative. Species outside the kingdom of Bacteria will return a value <code>NA</code>. Functions <code>is_gram_negative()</code> and <code>is_gram_positive()</code> always return <code>TRUE</code> or <code>FALSE</code>, even for species outside the kingdom of Bacteria.</p>
|
||||
<p>All output will be <a href='translate.html'>translate</a>d where possible.</p>
|
||||
<p>The function <code>mo_url()</code> will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species.</p>
|
||||
<h2 class="hasAnchor" id="stable-lifecycle"><a class="anchor" href="#stable-lifecycle"></a>Stable lifecycle</h2>
|
||||
|
@ -82,7 +82,7 @@
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">AMR (for R)</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9000</span>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.4.0.9001</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
Reference in New Issue
Block a user