nope, but this might be

This commit is contained in:
dr. M.S. (Matthijs) Berends 2022-10-04 23:38:08 +02:00
parent aa06aad4ea
commit 4e9de9eb5d
5 changed files with 18 additions and 19 deletions

View File

@ -1,5 +1,5 @@
Package: AMR
Version: 1.8.2.9028
Version: 1.8.2.9029
Date: 2022-10-04
Title: Antimicrobial Resistance Data Analysis
Description: Functions to simplify and standardise antimicrobial resistance (AMR)

View File

@ -1,4 +1,4 @@
# AMR 1.8.2.9028
# AMR 1.8.2.9029
This version will eventually become v2.0! We're happy to reach a new major milestone soon!

View File

@ -1369,12 +1369,12 @@ trimws2 <- function(..., whitespace = "[\u0009\u000A\u000B\u000C\u000D\u0020\u00
# Faster data.table implementations ----
match <- function(x, ...) {
if (isTRUE(AMR_env$has_data.table) && is.character(x)) {
match <- function(x, table, ...) {
if (isTRUE(AMR_env$has_data.table) && is.character(x) && is.character(table)) {
# data.table::chmatch() is 35% faster than base::match() for character
getExportedValue(name = "chmatch", ns = asNamespace("data.table"))(x, ...)
getExportedValue(name = "chmatch", ns = asNamespace("data.table"))(x, table, ...)
} else {
base::match(x, ...)
base::match(x, table, ...)
}
}
`%in%` <- function(x, table) {
@ -1490,7 +1490,16 @@ if (getRversion() < "3.5.0") {
isFALSE <- function(x) {
is.logical(x) && length(x) == 1L && !is.na(x) && !x
}
# trims() was introduced in 3.3.0, but its argument `whitespace` only in 3.5.0
}
if (getRversion() < "3.6.0") {
str2lang <- function(s) {
stopifnot(length(s) == 1L)
ex <- parse(text = s, keep.source = FALSE)
stopifnot(length(ex) == 1L)
ex[[1L]]
}
# trims() was introduced in 3.3.0, but its argument `whitespace` only in 3.6.0
trimws <- function(x, which = c("both", "left", "right"), whitespace = "[ \t\r\n]") {
which <- match.arg(which)
mysub <- function(re, x) sub(re, "", x, perl = TRUE)
@ -1502,15 +1511,6 @@ if (getRversion() < "3.5.0") {
}
}
if (getRversion() < "3.6.0") {
str2lang <- function(s) {
stopifnot(length(s) == 1L)
ex <- parse(text = s, keep.source = FALSE)
stopifnot(length(ex) == 1L)
ex[[1L]]
}
}
if (getRversion() < "4.0.0") {
deparse1 <- function(expr, collapse = " ", width.cutoff = 500L, ...) {
paste(deparse(expr, width.cutoff, ...), collapse = collapse)

1
R/mo.R
View File

@ -826,7 +826,6 @@ print.mo_uncertainties <- function(x, ...) {
" -> ",
paste0(
font_bold(font_italic(x[i, ]$fullname)),
ifelse(!is.na(x[i, ]$renamed_to), paste(", renamed to", font_italic(x[i, ]$renamed_to)), ""),
" (", x[i, ]$mo, ", ", score_set_colour(score_formatted, score), ")"
)
),

View File

@ -54,11 +54,11 @@ if (identical(Sys.getenv("R_RUN_TINYTEST"), "true")) {
}
if (getRversion() < "3.5.0") {
isFALSE <- AMR:::isFALSE
# trims() was introduced in 3.3.0, but its argument `whitespace` only in 3.5.0
trimws <- AMR:::trimws
}
if (getRversion() < "3.6.0") {
str2lang <- AMR:::str2lang
# trims() was introduced in 3.3.0, but its argument `whitespace` only in 3.6.0
trimws <- AMR:::trimws
}
if (getRversion() < "4.0.0") {
deparse1 <- AMR:::deparse1