<!-- Generated by pkgdown: do not edit by hand --><htmllang="en"><head><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"><metacharset="utf-8"><metahttp-equiv="X-UA-Compatible"content="IE=edge"><metaname="viewport"content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Italicise Taxonomic Families, Genera, Species, Subspecies — italicise_taxonomy • AMR (for R)</title><!-- favicons --><linkrel="icon"type="image/png"sizes="16x16"href="../favicon-16x16.png"><linkrel="icon"type="image/png"sizes="32x32"href="../favicon-32x32.png"><linkrel="apple-touch-icon"type="image/png"sizes="180x180"href="../apple-touch-icon.png"><linkrel="apple-touch-icon"type="image/png"sizes="120x120"href="../apple-touch-icon-120x120.png"><linkrel="apple-touch-icon"type="image/png"sizes="76x76"href="../apple-touch-icon-76x76.png"><linkrel="apple-touch-icon"type="image/png"sizes="60x60"href="../apple-touch-icon-60x60.png"><scriptsrc="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><metaname="viewport"content="width=device-width, initial-scale=1, shrink-to-fit=no"><linkhref="../deps/bootstrap-5.3.1/bootstrap.min.css"rel="stylesheet"><scriptsrc="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><linkhref="../deps/Lato-0.4.9/font.css"rel="stylesheet"><linkhref="../deps/Fira_Code-0.4.9/font.css"rel="stylesheet"><linkhref="../deps/font-awesome-6.4.2/css/all.min.css"rel="stylesheet"><linkhref="../deps/font-awesome-6.4.2/css/v4-shims.min.css"rel="stylesheet"><scriptsrc="../deps/headroom-0.11.0/headroom.min.js"></script><scriptsrc="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><scriptsrc="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><scriptsrc="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><scriptsrc="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><scriptsrc="../deps/search-1.0.0/fuse.min.js"></script><scriptsrc="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><scriptsrc="../pkgdown.js"></script><linkhref="../extra.css"rel="stylesheet"><scriptsrc="../extra.js"></script><metaproperty="og:title"content="Italicise Taxonomic Families, Genera, Species, Subspecies — italicise_taxonomy"><metaname="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."><metaproperty="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."><metaproperty="og:image"content="https://msberends.github.io/AMR/logo.svg"><metaname="twitter:card"content="summary_large_image"><metaname="twitter:creator"content="@msberends"><metaname="twitter:site"content="@msberends"></head><body>
<buttonclass="nav-link dropdown-toggle"type="button"id="dropdown-how-to"data-bs-toggle="dropdown"aria-expanded="false"aria-haspopup="true"><spanclass="fa fa-question-circle"></span> How to</button>
<ulclass="dropdown-menu"aria-labelledby="dropdown-how-to"><li><aclass="dropdown-item"href="../articles/AMR.html"><spanclass="fa fa-directions"></span> Conduct AMR Analysis</a></li>
<buttonclass="nav-link dropdown-toggle"type="button"id="dropdown-with-other-pkgs"data-bs-toggle="dropdown"aria-expanded="false"aria-haspopup="true"><spanclass="fa fa-layer-group"></span> With other pkgs</button>
<ulclass="dropdown-menu"aria-labelledby="dropdown-with-other-pkgs"><li><aclass="dropdown-item"href="../articles/other_pkg.html"><spanclass="fa fa-layer-group"></span> AMR & dplyr/tidyverse</a></li>
<li><aclass="dropdown-item"href="../articles/other_pkg.html"><spanclass="fa fa-layer-group"></span> AMR & data.table</a></li>
<li><aclass="dropdown-item"href="../articles/other_pkg.html"><spanclass="fa fa-layer-group"></span> AMR & tidymodels</a></li>
<li><aclass="dropdown-item"href="../articles/other_pkg.html"><spanclass="fa fa-layer-group"></span> AMR & base R</a></li>
<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>
<span><spanclass="fu">italicize_taxonomy</span><spanclass="op">(</span><spanclass="va">string</span>, type <spanclass="op">=</span><spanclass="fu"><ahref="https://rdrr.io/r/base/c.html"class="external-link">c</a></span><spanclass="op">(</span><spanclass="st">"markdown"</span>, <spanclass="st">"ansi"</span>, <spanclass="st">"html"</span><spanclass="op">)</span><spanclass="op">)</span></span></code></pre></div>
<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>
<divclass="sourceCode"><preclass="sourceCode r"><code><spanclass="r-in"><span><spanclass="fu">italicise_taxonomy</span><spanclass="op">(</span><spanclass="st">"An overview of Staphylococcus aureus isolates"</span><spanclass="op">)</span></span></span>
<spanclass="r-out co"><spanclass="r-pr">#></span> [1] "An overview of *Staphylococcus aureus* isolates"</span>
<spanclass="r-in"><span><spanclass="fu">italicise_taxonomy</span><spanclass="op">(</span><spanclass="st">"An overview of S. aureus isolates"</span><spanclass="op">)</span></span></span>
<spanclass="r-out co"><spanclass="r-pr">#></span> [1] "An overview of *S. aureus* isolates"</span>
<spanclass="r-in"><span></span></span>
<spanclass="r-in"><span><spanclass="fu"><ahref="https://rdrr.io/r/base/cat.html"class="external-link">cat</a></span><spanclass="op">(</span><spanclass="fu">italicise_taxonomy</span><spanclass="op">(</span><spanclass="st">"An overview of S. aureus isolates"</span>, type <spanclass="op">=</span><spanclass="st">"ansi"</span><spanclass="op">)</span><spanclass="op">)</span></span></span>
<p><code>AMR</code> (for R). Free and open-source, licenced under the <atarget="_blank"href="https://github.com/msberends/AMR/blob/main/LICENSE"class="external-link">GNU General Public License version 2.0 (GPL-2)</a>.<br>Developed at the <atarget="_blank"href="https://www.rug.nl"class="external-link">University of Groningen</a> and <atarget="_blank"href="https://www.umcg.nl"class="external-link">University Medical Center Groningen</a> in The Netherlands.</p>