mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 15:01:51 +02:00
Built site for AMR: 1.8.2.9071@fe09e92
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">AMR (for R)</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9069</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8.2.9071</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">
|
||||
@ -151,18 +151,27 @@
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
|
||||
<p>Due to how <span style="R">R</span> works, the <code>add_custom_antimicrobials()</code> function has to be run in every <span style="R">R</span> session - added antimicrobials are not stored between sessions and are thus lost when <span style="R">R</span> is exited. It is possible to save the antimicrobial additions to your <code>.Rprofile</code> file to circumvent this, although this requires to load the <code>AMR</code> package at every start-up:</p>
|
||||
<p></p><div class="sourceCode r"><pre><code><span><span class="co"># Open .Rprofile file</span></span>
|
||||
<span><span class="fu">utils</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/r/utils/file.edit.html" class="external-link">file.edit</a></span><span class="op">(</span><span class="st">"~/.Rprofile"</span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
<span><span class="co"># Add custom antibiotic drug codes:</span></span>
|
||||
<span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://msberends.github.io/AMR/">AMR</a></span><span class="op">)</span></span>
|
||||
<span><span class="fu"><a href="../reference/add_custom_antimicrobials.html">add_custom_antimicrobials</a></span><span class="op">(</span></span>
|
||||
<span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a></span><span class="op">(</span>ab <span class="op">=</span> <span class="st">"TESTAB"</span>,</span>
|
||||
<span> name <span class="op">=</span> <span class="st">"Test Antibiotic"</span>,</span>
|
||||
<span> group <span class="op">=</span> <span class="st">"Test Group"</span><span class="op">)</span></span>
|
||||
<span><span class="op">)</span></span></code></pre><p></p></div>
|
||||
<p>Use <code>clear_custom_antimicrobials()</code> to clear the previously added antimicrobials.</p>
|
||||
<p><strong>Important:</strong> Due to how <span style="R">R</span> works, the <code>add_custom_antimicrobials()</code> function has to be run in every <span style="R">R</span> session - added antimicrobials are not stored between sessions and are thus lost when <span style="R">R</span> is exited.</p>
|
||||
<p>There are two ways to automate this process:</p>
|
||||
<p><strong>Method 1:</strong> Save the antimicrobials to a local or remote file (can even be the internet). To use this method:</p><ol><li><p>Create a data set in the structure of the <a href="antibiotics.html">antibiotics</a> data set (containing at the very least columns "ab" and "name") and save it with <code><a href="https://rdrr.io/r/base/readRDS.html" class="external-link">saveRDS()</a></code> to a location of choice, e.g. <code>"~/my_custom_ab.rds"</code>, or any remote location.</p></li>
|
||||
<li><p>Set the file location to the <code>AMR_custom_ab</code> <span style="R">R</span> option: <code>options(AMR_custom_ab = "~/my_custom_ab.rds")</code>. This can even be a remote file location, such as an https URL. Since options are not saved between <span style="R">R</span> sessions, it is best to save this option to the <code>.Rprofile</code> file so that it will loaded on start-up of <span style="R">R</span>. To do this, open the <code>.Rprofile</code> file using e.g. <code>utils::file.edit("~/.Rprofile")</code>, add this text and save the file:</p>
|
||||
<p></p><div class="sourceCode r"><pre><code><span><span class="co"># Add custom antibiotic drug codes:</span></span>
|
||||
<span><span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">options</a></span><span class="op">(</span>AMR_custom_ab <span class="op">=</span> <span class="st">"~/my_custom_ab.rds"</span><span class="op">)</span></span></code></pre><p></p></div>
|
||||
<p>Upon package load, this file will be loaded and run through the <code>add_custom_antimicrobials()</code> function.</p></li>
|
||||
</ol><p><strong>Method 2:</strong> Save the antimicrobial additions directly to your <code>.Rprofile</code> file. An important downside is that this requires to load the <code>AMR</code> package at every start-up. To use this method:</p><ol><li><p>Edit the <code>.Rprofile</code> file using e.g. <code>utils::file.edit("~/.Rprofile")</code>.</p></li>
|
||||
<li><p>Add a text like below and save the file:</p>
|
||||
<p></p><div class="sourceCode r"><pre><code><span> <span class="co"># Add custom antibiotic drug codes:</span></span>
|
||||
<span> <span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://msberends.github.io/AMR/">AMR</a></span><span class="op">)</span></span>
|
||||
<span> <span class="fu"><a href="../reference/add_custom_antimicrobials.html">add_custom_antimicrobials</a></span><span class="op">(</span></span>
|
||||
<span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a></span><span class="op">(</span>ab <span class="op">=</span> <span class="st">"TESTAB"</span>,</span>
|
||||
<span> name <span class="op">=</span> <span class="st">"Test Antibiotic"</span>,</span>
|
||||
<span> group <span class="op">=</span> <span class="st">"Test Group"</span><span class="op">)</span></span>
|
||||
<span> <span class="op">)</span></span></code></pre><p></p></div></li>
|
||||
</ol><p>Use <code>clear_custom_antimicrobials()</code> to clear the previously added antimicrobials.</p>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="see-also">See also<a class="anchor" aria-label="anchor" href="#see-also"></a></h2>
|
||||
<div class="dont-index"><p><code><a href="add_custom_microorganisms.html">add_custom_microorganisms()</a></code> to add custom microorganisms to this package.</p></div>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
@ -253,7 +262,7 @@
|
||||
<span class="r-in"><span> ab <span class="op">=</span> <span class="st">"COFLU"</span>,</span></span>
|
||||
<span class="r-in"><span> name <span class="op">=</span> <span class="st">"Co-fluampicil"</span>,</span></span>
|
||||
<span class="r-in"><span> atc <span class="op">=</span> <span class="st">"J01CR50"</span>,</span></span>
|
||||
<span class="r-in"><span> group <span class="op">=</span> <span class="st">"Beta-lactams/penicillines"</span></span></span>
|
||||
<span class="r-in"><span> group <span class="op">=</span> <span class="st">"Beta-lactams/penicillins"</span></span></span>
|
||||
<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-msg co"><span class="r-pr">#></span> ℹ Added one record to the internal antibiotics data set.</span>
|
||||
|
Reference in New Issue
Block a user