1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-25 18:46:11 +01:00

(v1.6.0.9016) website update and c() fixes

This commit is contained in:
dr. M.S. (Matthijs) Berends 2021-05-03 13:06:43 +02:00
parent 12a8d59869
commit f33e61bac7
25 changed files with 97 additions and 47 deletions

View File

@ -1,5 +1,5 @@
Package: AMR Package: AMR
Version: 1.6.0.9015 Version: 1.6.0.9016
Date: 2021-05-03 Date: 2021-05-03
Title: Antimicrobial Resistance Data Analysis Title: Antimicrobial Resistance Data Analysis
Authors@R: c( Authors@R: c(

View File

@ -1,4 +1,4 @@
# `AMR` 1.6.0.9015 # `AMR` 1.6.0.9016
## <small>Last updated: 3 May 2021</small> ## <small>Last updated: 3 May 2021</small>
### New ### New

View File

@ -458,7 +458,7 @@ stop_ifnot <- function(expr, ..., call = TRUE) {
ifelse(!is.na(y), y, NA)) ifelse(!is.na(y), y, NA))
} }
class_integrity_check <- function(value, type, check_vector) { return_after_integrity_check <- function(value, type, check_vector) {
if (!all(value[!is.na(value)] %in% check_vector)) { if (!all(value[!is.na(value)] %in% check_vector)) {
warning_(paste0("invalid ", type, ", NA generated"), call = FALSE) warning_(paste0("invalid ", type, ", NA generated"), call = FALSE)
value[!value %in% check_vector] <- NA value[!value %in% check_vector] <- NA

9
R/ab.R
View File

@ -551,7 +551,7 @@ as.data.frame.ab <- function(x, ...) {
"[<-.ab" <- function(i, j, ..., value) { "[<-.ab" <- function(i, j, ..., value) {
y <- NextMethod() y <- NextMethod()
attributes(y) <- attributes(i) attributes(y) <- attributes(i)
class_integrity_check(y, "antimicrobial code", antibiotics$ab) return_after_integrity_check(y, "antimicrobial code", antibiotics$ab)
} }
#' @method [[<- ab #' @method [[<- ab
#' @export #' @export
@ -559,15 +559,16 @@ as.data.frame.ab <- function(x, ...) {
"[[<-.ab" <- function(i, j, ..., value) { "[[<-.ab" <- function(i, j, ..., value) {
y <- NextMethod() y <- NextMethod()
attributes(y) <- attributes(i) attributes(y) <- attributes(i)
class_integrity_check(y, "antimicrobial code", antibiotics$ab) return_after_integrity_check(y, "antimicrobial code", antibiotics$ab)
} }
#' @method c ab #' @method c ab
#' @export #' @export
#' @noRd #' @noRd
c.ab <- function(x, ...) { c.ab <- function(...) {
x <- list(...)[[1L]]
y <- NextMethod() y <- NextMethod()
attributes(y) <- attributes(x) attributes(y) <- attributes(x)
class_integrity_check(y, "antimicrobial code", antibiotics$ab) return_after_integrity_check(y, "antimicrobial code", antibiotics$ab)
} }
#' @method unique ab #' @method unique ab

View File

@ -182,11 +182,8 @@ print.disk <- function(x, ...) {
#' @method c disk #' @method c disk
#' @export #' @export
#' @noRd #' @noRd
c.disk <- function(x, ...) { c.disk <- function(...) {
y <- NextMethod() as.disk(unlist(lapply(list(...), as.character)))
y <- as.disk(y)
attributes(y) <- attributes(x)
y
} }
#' @method unique disk #' @method unique disk

View File

@ -115,5 +115,8 @@ italicise_taxonomy <- function(string, type = c("markdown", "ansi")) {
#' @rdname italicise_taxonomy #' @rdname italicise_taxonomy
#' @export #' @export
italicize_taxonomy <- function(string, type = c("markdown", "ansi")) { italicize_taxonomy <- function(string, type = c("markdown", "ansi")) {
italicise(string = string, type = type) if (missing(type)) {
type <- "markdown"
}
italicise_taxonomy(string = string, type = type)
} }

View File

@ -307,10 +307,8 @@ as.matrix.mic <- function(x, ...) {
#' @method c mic #' @method c mic
#' @export #' @export
#' @noRd #' @noRd
c.mic <- function(x, ...) { c.mic <- function(...) {
y <- unlist(lapply(list(...), as.character)) as.mic(unlist(lapply(list(...), as.character)))
x <- as.character(x)
as.mic(c(x, y))
} }
#' @method unique mic #' @method unique mic

31
R/mo.R
View File

@ -1677,7 +1677,7 @@ pillar_shaft.mo <- function(x, ...) {
} else { } else {
col <- "The data" col <- "The data"
} }
warning_(col, " contains old microbial codes (from a previous AMR package version). ", warning_(col, " contains old MO codes (from a previous AMR package version). ",
"Please update your MO codes with `as.mo()`.", "Please update your MO codes with `as.mo()`.",
call = FALSE) call = FALSE)
} }
@ -1751,6 +1751,11 @@ print.mo <- function(x, print.shortnames = FALSE, ...) {
} }
x <- as.character(x) x <- as.character(x)
names(x) <- x_names names(x) <- x_names
if (!all(x[!is.na(x)] %in% MO_lookup$mo)) {
warning_("Some MO codes are from a previous AMR package version. ",
"Please update these MO codes with `as.mo()`.",
call = FALSE)
}
print.default(x, quote = FALSE) print.default(x, quote = FALSE)
} }
@ -1777,7 +1782,7 @@ summary.mo <- function(object, ...) {
#' @noRd #' @noRd
as.data.frame.mo <- function(x, ...) { as.data.frame.mo <- function(x, ...) {
if (!all(x[!is.na(x)] %in% MO_lookup$mo)) { if (!all(x[!is.na(x)] %in% MO_lookup$mo)) {
warning_("The data contains old microbial codes (from a previous AMR package version). ", warning_("The data contains old MO codes (from a previous AMR package version). ",
"Please update your MO codes with `as.mo()`.", "Please update your MO codes with `as.mo()`.",
call = FALSE) call = FALSE)
} }
@ -1812,8 +1817,8 @@ as.data.frame.mo <- function(x, ...) {
y <- NextMethod() y <- NextMethod()
attributes(y) <- attributes(i) attributes(y) <- attributes(i)
# must only contain valid MOs # must only contain valid MOs
class_integrity_check(y, "microorganism code", c(as.character(microorganisms$mo), return_after_integrity_check(y, "microorganism code", c(as.character(microorganisms$mo),
as.character(microorganisms.translation$mo_old))) as.character(microorganisms.translation$mo_old)))
} }
#' @method [[<- mo #' @method [[<- mo
#' @export #' @export
@ -1822,18 +1827,18 @@ as.data.frame.mo <- function(x, ...) {
y <- NextMethod() y <- NextMethod()
attributes(y) <- attributes(i) attributes(y) <- attributes(i)
# must only contain valid MOs # must only contain valid MOs
class_integrity_check(y, "microorganism code", c(as.character(microorganisms$mo), return_after_integrity_check(y, "microorganism code", c(as.character(microorganisms$mo),
as.character(microorganisms.translation$mo_old))) as.character(microorganisms.translation$mo_old)))
} }
#' @method c mo #' @method c mo
#' @export #' @export
#' @noRd #' @noRd
c.mo <- function(x, ...) { c.mo <- function(...) {
x <- list(...)[[1L]]
y <- NextMethod() y <- NextMethod()
attributes(y) <- attributes(x) attributes(y) <- attributes(x)
# must only contain valid MOs return_after_integrity_check(y, "microorganism code", c(as.character(microorganisms$mo),
class_integrity_check(y, "microorganism code", c(as.character(microorganisms$mo), as.character(microorganisms.translation$mo_old)))
as.character(microorganisms.translation$mo_old)))
} }
#' @method unique mo #' @method unique mo
@ -2058,10 +2063,10 @@ replace_old_mo_codes <- function(x, property) {
n_matched <- length(matched[!is.na(matched)]) n_matched <- length(matched[!is.na(matched)])
if (property != "mo") { if (property != "mo") {
message_(font_blue(paste0("The input contained ", n_matched, message_(font_blue(paste0("The input contained ", n_matched,
" old microbial code", ifelse(n_matched == 1, "", "s"), " old MO code", ifelse(n_matched == 1, "", "s"),
" (from a previous AMR package version). Please update your MO codes with `as.mo()`."))) " (from a previous AMR package version). Please update your MO codes with `as.mo()`.")))
} else { } else {
message_(font_blue(paste0(n_matched, " old microbial code", ifelse(n_matched == 1, "", "s"), message_(font_blue(paste0(n_matched, " old MO code", ifelse(n_matched == 1, "", "s"),
" (from a previous AMR package version) ", " (from a previous AMR package version) ",
ifelse(n_matched == 1, "was", "were"), ifelse(n_matched == 1, "was", "were"),
" updated to ", ifelse(n_matched == 1, "a ", ""), " updated to ", ifelse(n_matched == 1, "a ", ""),
@ -2100,7 +2105,7 @@ repair_reference_df <- function(reference_df) {
reference_df[, "x"] <- as.character(reference_df[, "x", drop = TRUE]) reference_df[, "x"] <- as.character(reference_df[, "x", drop = TRUE])
reference_df[, "mo"] <- as.character(reference_df[, "mo", drop = TRUE]) reference_df[, "mo"] <- as.character(reference_df[, "mo", drop = TRUE])
# some microbial codes might be old # some MO codes might be old
reference_df[, "mo"] <- as.mo(reference_df[, "mo", drop = TRUE]) reference_df[, "mo"] <- as.mo(reference_df[, "mo", drop = TRUE])
reference_df reference_df
} }

View File

@ -177,6 +177,7 @@ reference:
- "`availability`" - "`availability`"
- "`get_locale`" - "`get_locale`"
- "`ggplot_pca`" - "`ggplot_pca`"
- "`italicise_taxonomy`"
- "`join`" - "`join`"
- "`like`" - "`like`"
- "`mo_matching_score`" - "`mo_matching_score`"

Binary file not shown.

View File

@ -81,7 +81,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="https://msberends.github.io/AMR//index.html">AMR (for R)</a> <a class="navbar-link" href="https://msberends.github.io/AMR//index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9015</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9016</span>
</span> </span>
</div> </div>

View File

@ -81,7 +81,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a> <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.6.0.9015</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9016</span>
</span> </span>
</div> </div>

View File

@ -81,7 +81,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <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.6.0.9015</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9016</span>
</span> </span>
</div> </div>

View File

@ -81,7 +81,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a> <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.6.0.9015</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9016</span>
</span> </span>
</div> </div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

@ -42,7 +42,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a> <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.6.0.9015</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9016</span>
</span> </span>
</div> </div>
@ -206,7 +206,7 @@
<p>This package is <a href="https://en.wikipedia.org/wiki/Dependency_hell">fully independent of any other R package</a> and works on Windows, macOS and Linux with all versions of R since R-3.0.0 (April 2013). <strong>It was designed to work in any setting, including those with very limited resources</strong>. It was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the <a href="https://www.rug.nl">University of Groningen</a>, in collaboration with non-profit organisations <a href="https://www.certe.nl">Certe Medical Diagnostics and Advice Foundation</a> and <a href="https://www.umcg.nl">University Medical Center Groningen</a>. This R package is <a href="./news">actively maintained</a> and is free software (see <a href="#copyright">Copyright</a>).</p> <p>This package is <a href="https://en.wikipedia.org/wiki/Dependency_hell">fully independent of any other R package</a> and works on Windows, macOS and Linux with all versions of R since R-3.0.0 (April 2013). <strong>It was designed to work in any setting, including those with very limited resources</strong>. It was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the <a href="https://www.rug.nl">University of Groningen</a>, in collaboration with non-profit organisations <a href="https://www.certe.nl">Certe Medical Diagnostics and Advice Foundation</a> and <a href="https://www.umcg.nl">University Medical Center Groningen</a>. This R package is <a href="./news">actively maintained</a> and is free software (see <a href="#copyright">Copyright</a>).</p>
<div class="main-content" style="display: inline-block;"> <div class="main-content" style="display: inline-block;">
<p> <p>
<a href="./countries_large.png" target="_blank"><img src="./countries.png" class="countries_map"></a> <strong>Used in 155 countries</strong><br> Since its first public release in early 2018, this package has been downloaded from 155 countries. Click the map to enlarge and to see the country names. <a href="./countries_large.png" target="_blank"><img src="./countries.png" class="countries_map"></a> <strong>Used in 162 countries</strong><br> Since its first public release in early 2018, this package has been downloaded from 162 countries. Click the map to enlarge and to see the country names.
</p> </p>
</div> </div>
<div id="with-amr-for-r-theres-always-a-knowledgeable-microbiologist-by-your-side" class="section level5"> <div id="with-amr-for-r-theres-always-a-knowledgeable-microbiologist-by-your-side" class="section level5">

View File

@ -81,7 +81,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <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.6.0.9015</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9016</span>
</span> </span>
</div> </div>
@ -236,9 +236,9 @@
<small>Source: <a href='https://github.com/msberends/AMR/blob/master/NEWS.md'><code>NEWS.md</code></a></small> <small>Source: <a href='https://github.com/msberends/AMR/blob/master/NEWS.md'><code>NEWS.md</code></a></small>
</div> </div>
<div id="amr-1609015" class="section level1"> <div id="amr-1609016" class="section level1">
<h1 class="page-header" data-toc-text="1.6.0.9015"> <h1 class="page-header" data-toc-text="1.6.0.9016">
<a href="#amr-1609015" class="anchor"></a><small> Unreleased </small><code>AMR</code> 1.6.0.9015</h1> <a href="#amr-1609016" class="anchor"></a><small> Unreleased </small><code>AMR</code> 1.6.0.9016</h1>
<div id="last-updated-3-may-2021" class="section level2"> <div id="last-updated-3-may-2021" class="section level2">
<h2 class="hasAnchor"> <h2 class="hasAnchor">
<a href="#last-updated-3-may-2021" class="anchor"></a><small>Last updated: 3 May 2021</small> <a href="#last-updated-3-may-2021" class="anchor"></a><small>Last updated: 3 May 2021</small>
@ -340,7 +340,7 @@
<span class="co">#&gt; Filtering on oxazolidinones: value in column `LNZ` (linezolid) is either "R", "S" or "I"</span></code></pre></div> <span class="co">#&gt; Filtering on oxazolidinones: value in column `LNZ` (linezolid) is either "R", "S" or "I"</span></code></pre></div>
</li> </li>
<li><p>Support for custom MDRO guidelines, using the new <code><a href="../reference/mdro.html">custom_mdro_guideline()</a></code> function, please see <code><a href="../reference/mdro.html">mdro()</a></code> for additional info</p></li> <li><p>Support for custom MDRO guidelines, using the new <code><a href="../reference/mdro.html">custom_mdro_guideline()</a></code> function, please see <code><a href="../reference/mdro.html">mdro()</a></code> for additional info</p></li>
<li><p><code><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot()</a></code> generics for classes <code>&lt;mic&gt;</code> and <code>&lt;disk&gt;</code></p></li> <li><p><code>ggplot()</code> generics for classes <code>&lt;mic&gt;</code> and <code>&lt;disk&gt;</code></p></li>
<li> <li>
<p>Function <code><a href="../reference/mo_property.html">mo_is_yeast()</a></code>, which determines whether a microorganism is a member of the taxonomic class Saccharomycetes or the taxonomic order Saccharomycetales:</p> <p>Function <code><a href="../reference/mo_property.html">mo_is_yeast()</a></code>, which determines whether a microorganism is a member of the taxonomic class Saccharomycetes or the taxonomic order Saccharomycetales:</p>
<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r"> <div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
@ -397,7 +397,7 @@
<li>Plotting of MIC and disk diffusion values now support interpretation colouring if you supply the microorganism and antimicrobial agent</li> <li>Plotting of MIC and disk diffusion values now support interpretation colouring if you supply the microorganism and antimicrobial agent</li>
<li>All colours were updated to colour-blind friendly versions for values R, S and I for all plot methods (also applies to tibble printing)</li> <li>All colours were updated to colour-blind friendly versions for values R, S and I for all plot methods (also applies to tibble printing)</li>
<li>Interpretation of MIC and disk diffusion values to R/SI will now be translated if the system language is German, Dutch or Spanish (see <code>translate</code>)</li> <li>Interpretation of MIC and disk diffusion values to R/SI will now be translated if the system language is German, Dutch or Spanish (see <code>translate</code>)</li>
<li>Plotting is now possible with base R using <code><a href="../reference/plot.html">plot()</a></code> and with ggplot2 using <code><a href="https://ggplot2.tidyverse.org/reference/ggplot.html">ggplot()</a></code> on any vector of MIC and disk diffusion values</li> <li>Plotting is now possible with base R using <code><a href="../reference/plot.html">plot()</a></code> and with ggplot2 using <code>ggplot()</code> on any vector of MIC and disk diffusion values</li>
</ul> </ul>
</li> </li>
<li>Updated SNOMED codes to US Edition of SNOMED CT from 1 September 2020 and added the source to the help page of the <code>microorganisms</code> data set</li> <li>Updated SNOMED codes to US Edition of SNOMED CT from 1 September 2020 and added the source to the help page of the <code>microorganisms</code> data set</li>

View File

@ -12,7 +12,7 @@ articles:
datasets: datasets.html datasets: datasets.html
resistance_predict: resistance_predict.html resistance_predict: resistance_predict.html
welcome_to_AMR: welcome_to_AMR.html welcome_to_AMR: welcome_to_AMR.html
last_built: 2021-05-03T08:19Z last_built: 2021-05-03T11:04Z
urls: urls:
reference: https://msberends.github.io/AMR//reference reference: https://msberends.github.io/AMR//reference
article: https://msberends.github.io/AMR//articles article: https://msberends.github.io/AMR//articles

View File

@ -81,7 +81,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <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.6.0.9015</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9016</span>
</span> </span>
</div> </div>
@ -592,6 +592,12 @@
<td><p>PCA Biplot with <code>ggplot2</code></p></td> <td><p>PCA Biplot with <code>ggplot2</code></p></td>
</tr><tr> </tr><tr>
<td>
<p><code><a href="italicise_taxonomy.html">italicise_taxonomy()</a></code> <code><a href="italicise_taxonomy.html">italicize_taxonomy()</a></code> </p>
</td>
<td><p>Italicise Taxonomic Families, Genera, Species, Subspecies</p></td>
</tr><tr>
<td> <td>
<p><code><a href="join.html">inner_join_microorganisms()</a></code> <code><a href="join.html">left_join_microorganisms()</a></code> <code><a href="join.html">right_join_microorganisms()</a></code> <code><a href="join.html">full_join_microorganisms()</a></code> <code><a href="join.html">semi_join_microorganisms()</a></code> <code><a href="join.html">anti_join_microorganisms()</a></code> </p> <p><code><a href="join.html">inner_join_microorganisms()</a></code> <code><a href="join.html">left_join_microorganisms()</a></code> <code><a href="join.html">right_join_microorganisms()</a></code> <code><a href="join.html">full_join_microorganisms()</a></code> <code><a href="join.html">semi_join_microorganisms()</a></code> <code><a href="join.html">anti_join_microorganisms()</a></code> </p>
</td> </td>

View File

@ -81,7 +81,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a> <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.6.0.9015</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9016</span>
</span> </span>
</div> </div>

View File

@ -15,8 +15,8 @@ This package is [fully independent of any other R package](https://en.wikipedia.
<div class="main-content" style="display: inline-block;"> <div class="main-content" style="display: inline-block;">
<p> <p>
<a href="./countries_large.png" target="_blank"><img src="./countries.png" class="countries_map"></a> <a href="./countries_large.png" target="_blank"><img src="./countries.png" class="countries_map"></a>
<strong>Used in 155 countries</strong><br> <strong>Used in 162 countries</strong><br>
Since its first public release in early 2018, this package has been downloaded from 155 countries. Click the map to enlarge and to see the country names.</p> Since its first public release in early 2018, this package has been downloaded from 162 countries. Click the map to enlarge and to see the country names.</p>
</div> </div>
##### With `AMR` (for R), there's always a knowledgeable microbiologist by your side! ##### With `AMR` (for R), there's always a knowledgeable microbiologist by your side!

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

@ -0,0 +1,39 @@
# ==================================================================== #
# TITLE #
# Antimicrobial Resistance (AMR) Data Analysis for R #
# #
# SOURCE #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2021 Berends MS, Luz CF et al. #
# Developed at the University of Groningen, the Netherlands, in #
# collaboration with non-profit organisations Certe Medical #
# Diagnostics & Advice, and University Medical Center Groningen. #
# #
# This R package is free software; you can freely use and distribute #
# it for both personal and commercial purposes under the terms of the #
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
# the Free Software Foundation. #
# We created this package for both routine data analysis and academic #
# research and it was publicly released in the hope that it will be #
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
# #
# Visit our website for the full manual and a complete tutorial about #
# how to conduct AMR data analysis: https://msberends.github.io/AMR/ #
# ==================================================================== #
context("italicise_taxonomy.R")
test_that("italic taxonomy works", {
skip_on_cran()
expect_identical(italicise_taxonomy("test for E. coli"),
"test for *E. coli*")
expect_identical(italicise_taxonomy("test for E. coli"),
italicize_taxonomy("test for E. coli"))
if (has_colour()) {
expect_identical(italicise_taxonomy("test for E. coli", type = "ansi"),
"test for \033[3mE. coli\033[23m")
}
})