mirror of
https://github.com/msberends/AMR.git
synced 2026-11-28 22:06:10 +01:00
129 lines
16 KiB
HTML
129 lines
16 KiB
HTML
<!DOCTYPE html>
|
|
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><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>Italicise Taxonomic Families, Genera, Species, and Subspecies — italicise_taxonomy • AMR (for R)</title><!-- favicons --><link rel="icon" type="image/png" sizes="96x96" href="../favicon-96x96.png"><link rel="icon" type="”image/svg+xml”" href="../favicon.svg"><link rel="apple-touch-icon" sizes="180x180" href="../apple-touch-icon.png"><link rel="icon" sizes="any" href="../favicon.ico"><link rel="manifest" href="../site.webmanifest"><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.8/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.3.8/bootstrap.bundle.min.js"></script><link href="../deps/Lato-0.5.0/font.css" rel="stylesheet"><link href="../deps/Fira_Code-0.5.0/font.css" rel="stylesheet"><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><link href="../extra.css" rel="stylesheet"><script src="../extra.js"></script><meta property="og:title" content="Italicise Taxonomic Families, Genera, Species, and Subspecies — italicise_taxonomy"><meta name="description" content="According to the binomial nomenclature, the lowest four taxonomic levels (family, genus, species, subspecies) should be printed in italics. This function finds taxonomic names within strings and makes them italic."><meta property="og:description" content="According to the binomial nomenclature, the lowest four taxonomic levels (family, genus, species, subspecies) should be printed in italics. This function finds taxonomic names within strings and makes them italic."><meta property="og:image" content="https://amr-for-r.org/logo.svg"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css" integrity="sha384-nB0miv6/jRmo5UMMR1wu3Gz6NLsoTkbqJghGIsx//Rlm+ZU03BU6SQNC66uf4l5+" crossorigin="anonymous"><script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.js" integrity="sha384-7zkQWkzuo3B5mTepMUcHkMB5jZaolc2xDwL6VFqjFALcbeS9Ggm/Yr2r3Dy4lfFg" crossorigin="anonymous"></script><script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/contrib/auto-render.min.js" integrity="sha384-43gviWU0YVjaDtb/GhzOouOXtZMP/7XUzwPTstBeZFe/+rCMvRwr4yROQP43s0Xk" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script></head><body>
|
|
<a href="#main" class="visually-hidden-focusable">Skip to contents</a>
|
|
|
|
|
|
<nav class="navbar navbar-expand-lg fixed-top bg-primary" data-bs-theme="dark" aria-label="Site navigation"><div class="container">
|
|
|
|
<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="">3.1.0.9032</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 dropdown">
|
|
<button class="nav-link dropdown-toggle" type="button" id="dropdown-how-to" data-bs-toggle="dropdown" aria-expanded="false" aria-haspopup="true"><span class="fa fa-question-circle"></span> How to</button>
|
|
<ul class="dropdown-menu" aria-labelledby="dropdown-how-to"><li><a class="dropdown-item" href="../articles/AMR.html"><span class="fa fa-directions"></span> Conduct AMR Analysis</a></li>
|
|
<li><a class="dropdown-item" href="../reference/antibiogram.html"><span class="fa fa-file-prescription"></span> Generate Antibiogram (Trad./Syndromic/WISCA)</a></li>
|
|
<li><a class="dropdown-item" href="../articles/AMR_with_tidymodels.html"><span class="fa fa-square-root-variable"></span> Use AMR for Predictive Modelling (tidymodels)</a></li>
|
|
<li><a class="dropdown-item" href="../articles/datasets.html"><span class="fa fa-database"></span> Download Data Sets for Own Use</a></li>
|
|
<li><a class="dropdown-item" href="../reference/AMR-options.html"><span class="fa fa-gear"></span> Set User- Or Team-specific Package Settings</a></li>
|
|
<li><a class="dropdown-item" href="../articles/PCA.html"><span class="fa fa-compress"></span> Conduct Principal Component Analysis for AMR</a></li>
|
|
<li><a class="dropdown-item" href="../reference/mdro.html"><span class="fa fa-skull-crossbones"></span> Determine Multi-Drug Resistance (MDR)</a></li>
|
|
<li><a class="dropdown-item" href="../articles/WHONET.html"><span class="fa fa-globe-americas"></span> Work with WHONET Data</a></li>
|
|
<li><a class="dropdown-item" href="../articles/EUCAST.html"><span class="fa fa-exchange-alt"></span> Apply EUCAST Rules</a></li>
|
|
<li><a class="dropdown-item" href="../reference/mo_property.html"><span class="fa fa-bug"></span> Get Taxonomy of a Microorganism</a></li>
|
|
<li><a class="dropdown-item" href="../reference/ab_property.html"><span class="fa fa-capsules"></span> Get Properties of an Antibiotic Drug</a></li>
|
|
<li><a class="dropdown-item" href="../reference/av_property.html"><span class="fa fa-capsules"></span> Get Properties of an Antiviral Drug</a></li>
|
|
</ul></li>
|
|
<li class="nav-item"><a class="nav-link" href="../articles/chat.html"><span class="fa fa-wand-magic-sparkles"></span> AMR for R Assistant</a></li>
|
|
<li class="active nav-item"><a class="nav-link" href="../reference/index.html"><span class="fa fa-book-open"></span> Manual</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="../authors.html"><span class="fa fa-users"></span> Authors</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="nav-link" href="../news/index.html"><span class="fa fa-newspaper"></span> Changelog</a></li>
|
|
<li class="nav-item"><a class="external-link nav-link" href="https://github.com/msberends/AMR"><span class="fa fa-github"></span> Source Code</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.svg" class="logo" alt=""><h1>Italicise Taxonomic Families, Genera, Species, and Subspecies</h1>
|
|
<small class="dont-index">Source: <a href="https://github.com/msberends/AMR/blob/main/R/italicise_taxonomy.R" class="external-link"><code>R/italicise_taxonomy.R</code></a></small>
|
|
<div class="d-none name"><code>italicise_taxonomy.Rd</code></div>
|
|
</div>
|
|
|
|
<div class="ref-description section level2">
|
|
<p>According to the binomial nomenclature, the lowest four taxonomic levels (family, genus, species, subspecies) should be printed in italics. This function finds taxonomic names within strings and makes them italic.</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">italicise_taxonomy</span><span class="op">(</span><span class="va">string</span>, type <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">"markdown"</span>, <span class="st">"ansi"</span>, <span class="st">"html"</span>, <span class="st">"plotmath"</span><span class="op">)</span><span class="op">)</span></span>
|
|
<span></span>
|
|
<span><span class="fu">italicize_taxonomy</span><span class="op">(</span><span class="va">string</span>, type <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">"markdown"</span>, <span class="st">"ansi"</span>, <span class="st">"html"</span>, <span class="st">"plotmath"</span><span class="op">)</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-string">string<a class="anchor" aria-label="anchor" href="#arg-string"></a></dt>
|
|
<dd><p>A <a href="https://rdrr.io/r/base/character.html" class="external-link">character</a> (vector).</p></dd>
|
|
|
|
|
|
<dt id="arg-type">type<a class="anchor" aria-label="anchor" href="#arg-type"></a></dt>
|
|
<dd><p>Type of conversion of the taxonomic names, either "markdown", "html", "ansi" or "plotmath", see <em>Details</em>.</p></dd>
|
|
|
|
</dl></div>
|
|
<div class="section level2">
|
|
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
|
|
<p>For "markdown", "html" and "ansi", a <a href="https://rdrr.io/r/base/character.html" class="external-link">character</a> vector. For "plotmath", an <a href="https://rdrr.io/r/base/expression.html" class="external-link">expression</a> vector. Both have the same length as <code>string</code> and keep <code>NA</code> values.</p>
|
|
</div>
|
|
<div class="section level2">
|
|
<h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
|
|
<p>This function finds the taxonomic names and makes them italic based on the <a href="microorganisms.html">microorganisms</a> data set. Family and genus names are italicised anywhere in the text. Species and subspecies names are only italicised when they follow a genus, an abbreviated genus (such as "E." in "E. coli"), or another species or subspecies name, so that ordinary words that are also species names (such as "coli" or "major") stay upright. Subspecies may also follow "subsp.", "ssp." or "var.", which stay upright themselves, e.g., "<em>K. pneumoniae</em> subsp. <em>ozaenae</em>". <em>Salmonella</em> serovars (such as Typhimurium) and groups are not italicised, as is the convention. Punctuation around the names, such as brackets and commas, stays outside the italics.</p>
|
|
<p>The taxonomic names can be italicised using markdown (the default) by adding <code>*</code> before and after the taxonomic names, or <code><i></code> and <code></i></code> when using html. When using 'ansi', ANSI colours will be added using <code>\033[3m</code> before and <code>\033[23m</code> after the taxonomic names. If multiple ANSI colours are not available, no conversion will occur.</p>
|
|
<p>Use <code>type = "plotmath"</code> to get an <a href="https://rdrr.io/r/base/expression.html" class="external-link">expression</a> vector for plots (see <a href="https://rdrr.io/r/grDevices/plotmath.html" class="external-link">plotmath</a>), which works for titles, axes and legends in both base <span style="R">R</span> and <code>ggplot2</code>. For axis and legend labels, the function <code><a href="plot.html">labels_taxonomy()</a></code> does exactly this and can directly be used as labeller, e.g., <code>ggplot2::scale_x_discrete(labels = labels_taxonomy)</code>.</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="plot.html">labels_taxonomy()</a></code> to italicise taxonomic names in plot labels.</p></div>
|
|
</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">italicise_taxonomy</span><span class="op">(</span><span class="st">"An overview of Staphylococcus aureus isolates"</span><span class="op">)</span></span></span>
|
|
<span class="r-out co"><span class="r-pr">#></span> [1] "An overview of *Staphylococcus aureus* isolates"</span>
|
|
<span class="r-in"><span><span class="fu">italicise_taxonomy</span><span class="op">(</span><span class="st">"An overview of S. aureus isolates"</span><span class="op">)</span></span></span>
|
|
<span class="r-out co"><span class="r-pr">#></span> [1] "An overview of *S. aureus* isolates"</span>
|
|
<span class="r-in"><span><span class="fu">italicise_taxonomy</span><span class="op">(</span><span class="st">"Infections with E. coli (and coli bacteria in general)"</span><span class="op">)</span></span></span>
|
|
<span class="r-out co"><span class="r-pr">#></span> [1] "Infections with *E. coli* (and coli bacteria in general)"</span>
|
|
<span class="r-in"><span></span></span>
|
|
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/cat.html" class="external-link">cat</a></span><span class="op">(</span><span class="fu">italicise_taxonomy</span><span class="op">(</span><span class="st">"An overview of S. aureus isolates"</span>, type <span class="op">=</span> <span class="st">"ansi"</span><span class="op">)</span><span class="op">)</span></span></span>
|
|
<span class="r-out co"><span class="r-pr">#></span> An overview of <span style="font-style: italic;">S. aureus</span> isolates</span>
|
|
<span class="r-in"><span></span></span>
|
|
<span class="r-in"><span><span class="co"># for plots:</span></span></span>
|
|
<span class="r-in"><span><span class="fu">italicise_taxonomy</span><span class="op">(</span><span class="st">"An overview of S. aureus isolates"</span>, type <span class="op">=</span> <span class="st">"plotmath"</span><span class="op">)</span></span></span>
|
|
<span class="r-out co"><span class="r-pr">#></span> expression(paste("An overview of ", italic("S. aureus"), " isolates"))</span>
|
|
<span class="r-in"><span><span class="fu"><a href="plot.html">plot</a></span><span class="op">(</span><span class="fl">1</span><span class="op">:</span><span class="fl">10</span>, main <span class="op">=</span> <span class="fu">italicise_taxonomy</span><span class="op">(</span><span class="st">"Growth of S. aureus"</span>, type <span class="op">=</span> <span class="st">"plotmath"</span><span class="op">)</span><span class="op">)</span></span></span>
|
|
<span class="r-plt img"><img src="italicise_taxonomy-1.png" alt="" width="700" height="433"></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><code>AMR</code> (for R). Free and open-source, licenced under the <a target="_blank" href="https://github.com/msberends/AMR/blob/main/LICENSE" class="external-link">GNU GPL 2.0</a>. Developed at the <a target="_blank" href="https://www.rug.nl" class="external-link">University of Groningen</a> and <a target="_blank" href="https://www.umcg.nl" class="external-link">University Medical Center Groningen</a> in the Netherlands, in collaboration with <a href="https://amr-for-r.org/authors.html">many colleagues from around the world</a>.</p>
|
|
</div>
|
|
|
|
<div class="pkgdown-footer-right">
|
|
<p><a target="_blank" href="https://www.rug.nl" class="external-link"><img src="https://amr-for-r.org/logo_rug.svg" style="max-width: 150px;"></a><a target="_blank" href="https://www.umcg.nl" class="external-link"><img src="https://amr-for-r.org/logo_umcg.svg" style="max-width: 150px;"></a></p>
|
|
</div>
|
|
|
|
</footer></div>
|
|
|
|
|
|
|
|
|
|
|
|
</body></html>
|
|
|