mirror of
https://github.com/msberends/AMR.git
synced 2026-11-16 07:50:50 +01:00
(v3.1.0.9009) Fix the misaligned arrows in the message on taxonomically renamed microorganisms in colour-supporting consoles, by padding on the visible width instead of using format() (fixes #336)
This commit is contained in:
1 parent
08e68037db
commit
92bb8931c5
3 files changed
+11
-4
No files matched your search
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
Package: AMR
|
Package: AMR
|
||||||
Version: 3.1.0.9006
|
Version: 3.1.0.9009
|
||||||
Date: 2026-10-23
|
Date: 2026-10-30
|
||||||
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)
|
||||||
data analysis and to work with microbial and antimicrobial properties by
|
data analysis and to work with microbial and antimicrobial properties by
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
# AMR 3.1.0.9006
|
# AMR 3.1.0.9009
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
* Microorganism coercion (`as.mo()`)
|
||||||
|
* Fixed the misaligned arrows in the message on taxonomically renamed microorganisms in colour-supporting consoles, for old names whose author reference lacks "*et al.*" (#336)
|
||||||
|
|
||||||
### Other
|
### Other
|
||||||
* The manual index on the website was rewritten to improve findability, with sections ordered by task and a filter field
|
* The manual index on the website was rewritten to improve findability, with sections ordered by task and a filter field
|
||||||
|
|||||||
@@ -1144,7 +1144,10 @@ print.mo_renamed <- function(x, extra_txt = "", n = 25, ...) {
|
|||||||
rows <- seq_len(min(NROW(x), n))
|
rows <- seq_len(min(NROW(x), n))
|
||||||
|
|
||||||
message_("The following microorganism", ifelse(NROW(x) > 1, "s were", " was"), " taxonomically renamed", extra_txt, ":")
|
message_("The following microorganism", ifelse(NROW(x) > 1, "s were", " was"), " taxonomically renamed", extra_txt, ":")
|
||||||
old_format <- format(paste0(font_italic(x$old[rows], collapse = NULL), x$ref_old[rows])) # format() will set trailing spaces for textual alignment
|
old_format <- paste0(font_italic(x$old[rows], collapse = NULL), x$ref_old[rows])
|
||||||
|
# pad based on the visible width, since format() counts ANSI codes as characters
|
||||||
|
visible_width <- nchar(font_stripstyle(old_format), type = "width")
|
||||||
|
old_format <- paste0(old_format, strrep(" ", max(visible_width) - visible_width))
|
||||||
old_format <- gsub(" ", "\u00a0", old_format, fixed = TRUE)
|
old_format <- gsub(" ", "\u00a0", old_format, fixed = TRUE)
|
||||||
for (old_tax in rows) {
|
for (old_tax in rows) {
|
||||||
message_("\u00a0\u00a0", AMR_env$bullet_icon, " ", old_format[old_tax], " -> ", font_italic(x$new[old_tax]), x$ref_new[old_tax], as_note = FALSE)
|
message_("\u00a0\u00a0", AMR_env$bullet_icon, " ", old_format[old_tax], " -> ", font_italic(x$new[old_tax]), x$ref_new[old_tax], as_note = FALSE)
|
||||||
|
|||||||
Reference in new issue
Block a user