mirror of
https://github.com/msberends/AMR.git
synced 2025-01-15 22:41:38 +01:00
nope, but this might be
This commit is contained in:
parent
aa06aad4ea
commit
4e9de9eb5d
@ -1,5 +1,5 @@
|
|||||||
Package: AMR
|
Package: AMR
|
||||||
Version: 1.8.2.9028
|
Version: 1.8.2.9029
|
||||||
Date: 2022-10-04
|
Date: 2022-10-04
|
||||||
Title: Antimicrobial Resistance Data Analysis
|
Title: Antimicrobial Resistance Data Analysis
|
||||||
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
||||||
|
2
NEWS.md
2
NEWS.md
@ -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!
|
This version will eventually become v2.0! We're happy to reach a new major milestone soon!
|
||||||
|
|
||||||
|
@ -1369,12 +1369,12 @@ trimws2 <- function(..., whitespace = "[\u0009\u000A\u000B\u000C\u000D\u0020\u00
|
|||||||
|
|
||||||
# Faster data.table implementations ----
|
# Faster data.table implementations ----
|
||||||
|
|
||||||
match <- function(x, ...) {
|
match <- function(x, table, ...) {
|
||||||
if (isTRUE(AMR_env$has_data.table) && is.character(x)) {
|
if (isTRUE(AMR_env$has_data.table) && is.character(x) && is.character(table)) {
|
||||||
# data.table::chmatch() is 35% faster than base::match() for character
|
# 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 {
|
} else {
|
||||||
base::match(x, ...)
|
base::match(x, table, ...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`%in%` <- function(x, table) {
|
`%in%` <- function(x, table) {
|
||||||
@ -1490,7 +1490,16 @@ if (getRversion() < "3.5.0") {
|
|||||||
isFALSE <- function(x) {
|
isFALSE <- function(x) {
|
||||||
is.logical(x) && length(x) == 1L && !is.na(x) && !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]") {
|
trimws <- function(x, which = c("both", "left", "right"), whitespace = "[ \t\r\n]") {
|
||||||
which <- match.arg(which)
|
which <- match.arg(which)
|
||||||
mysub <- function(re, x) sub(re, "", x, perl = TRUE)
|
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") {
|
if (getRversion() < "4.0.0") {
|
||||||
deparse1 <- function(expr, collapse = " ", width.cutoff = 500L, ...) {
|
deparse1 <- function(expr, collapse = " ", width.cutoff = 500L, ...) {
|
||||||
paste(deparse(expr, width.cutoff, ...), collapse = collapse)
|
paste(deparse(expr, width.cutoff, ...), collapse = collapse)
|
||||||
|
1
R/mo.R
1
R/mo.R
@ -826,7 +826,6 @@ print.mo_uncertainties <- function(x, ...) {
|
|||||||
" -> ",
|
" -> ",
|
||||||
paste0(
|
paste0(
|
||||||
font_bold(font_italic(x[i, ]$fullname)),
|
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), ")"
|
" (", x[i, ]$mo, ", ", score_set_colour(score_formatted, score), ")"
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
@ -54,11 +54,11 @@ if (identical(Sys.getenv("R_RUN_TINYTEST"), "true")) {
|
|||||||
}
|
}
|
||||||
if (getRversion() < "3.5.0") {
|
if (getRversion() < "3.5.0") {
|
||||||
isFALSE <- AMR:::isFALSE
|
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") {
|
if (getRversion() < "3.6.0") {
|
||||||
str2lang <- AMR:::str2lang
|
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") {
|
if (getRversion() < "4.0.0") {
|
||||||
deparse1 <- AMR:::deparse1
|
deparse1 <- AMR:::deparse1
|
||||||
|
Loading…
Reference in New Issue
Block a user