diff --git a/DESCRIPTION b/DESCRIPTION index da929573..9d0ddb53 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 2.0.0.9006 -Date: 2023-04-14 +Version: 2.0.0.9007 +Date: 2023-04-15 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) data analysis and to work with microbial and antimicrobial properties by diff --git a/NEWS.md b/NEWS.md index 994062e6..9fa91d4e 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 2.0.0.9006 +# AMR 2.0.0.9007 ## Changed * formatting fix for `sir_interpretation_history()` diff --git a/R/mo.R b/R/mo.R index 97ae5b7a..e9cf623c 100755 --- a/R/mo.R +++ b/R/mo.R @@ -947,25 +947,25 @@ convert_colloquial_input <- function(x) { out <- rep(NA_character_, length(x)) # Streptococci, like GBS = Group B Streptococci (B_STRPT_GRPB) - out[x %like_case% "^g[abcdfghkl]s$"] <- gsub("g([abcdfghkl])s", +out[x %like_case% "^g[abcdefghijkl]s$"] <- gsub("g([abcdefghijkl])s", "B_STRPT_GRP\\U\\1", - x[x %like_case% "^g[abcdfghkl]s$"], + x[x %like_case% "^g[abcdefghijkl]s$"], perl = TRUE ) # Streptococci in different languages, like "estreptococos grupo B" - out[x %like_case% "strepto[ck]o[ck].* [abcdfghkl]$"] <- gsub(".*e?strepto[ck]o[ck].* ([abcdfghkl])$", + out[x %like_case% "strepto[ck]o[ck].* [abcdefghijkl]$"] <- gsub(".*e?strepto[ck]o[ck].* ([abcdefghijkl])$", "B_STRPT_GRP\\U\\1", - x[x %like_case% "strepto[ck]o[ck].* [abcdfghkl]$"], + x[x %like_case% "strepto[ck]o[ck].* [abcdefghijkl]$"], perl = TRUE ) - out[x %like_case% "strep[a-z]* group [abcdfghkl]$"] <- gsub(".* ([abcdfghkl])$", + out[x %like_case% "strep[a-z]* group [abcdefghijkl]$"] <- gsub(".* ([abcdefghijkl])$", "B_STRPT_GRP\\U\\1", - x[x %like_case% "strep[a-z]* group [abcdfghkl]$"], + x[x %like_case% "strep[a-z]* group [abcdefghijkl]$"], perl = TRUE ) - out[x %like_case% "group [abcdfghkl] strepto[ck]o[ck]"] <- gsub(".*group ([abcdfghkl]) strepto[ck]o[ck].*", + out[x %like_case% "group [abcdefghijkl] strepto[ck]o[ck]"] <- gsub(".*group ([abcdefghijkl]) strepto[ck]o[ck].*", "B_STRPT_GRP\\U\\1", - x[x %like_case% "group [abcdfghkl] strepto[ck]o[ck]"], + x[x %like_case% "group [abcdefghijkl] strepto[ck]o[ck]"], perl = TRUE ) out[x %like_case% "ha?emoly.*strep"] <- "B_STRPT_HAEM" @@ -975,14 +975,14 @@ convert_colloquial_input <- function(x) { out[x %like_case% "(viridans.* (strepto|^s).*|^vgs[^a-z]*$)"] <- "B_STRPT_VIRI" # Salmonella in different languages, like "Salmonella grupo B" - out[x %like_case% "salmonella.* [abcd]$"] <- gsub(".*salmonella.* ([abcd])$", + out[x %like_case% "salmonella.* [abcdefgh]$"] <- gsub(".*salmonella.* ([abcdefgh])$", "B_SLMNL_GRP\\U\\1", - x[x %like_case% "salmonella.* [abcd]$"], + x[x %like_case% "salmonella.* [abcdefgh]$"], perl = TRUE ) - out[x %like_case% "group [abcd] salmonella"] <- gsub(".*group ([abcd]) salmonella*", + out[x %like_case% "group [abcdefgh] salmonella"] <- gsub(".*group ([abcdefgh]) salmonella*", "B_SLMNL_GRP\\U\\1", - x[x %like_case% "group [abcd] salmonella"], + x[x %like_case% "group [abcdefgh] salmonella"], perl = TRUE ) diff --git a/R/sysdata.rda b/R/sysdata.rda index af353f49..1ca680ce 100755 Binary files a/R/sysdata.rda and b/R/sysdata.rda differ diff --git a/data-raw/microorganisms.dta b/data-raw/microorganisms.dta index 2b6e0b9b..b2ae86c5 100644 Binary files a/data-raw/microorganisms.dta and b/data-raw/microorganisms.dta differ diff --git a/data-raw/microorganisms.feather b/data-raw/microorganisms.feather index 60a4fea4..67d638f6 100644 Binary files a/data-raw/microorganisms.feather and b/data-raw/microorganisms.feather differ diff --git a/data-raw/microorganisms.md5 b/data-raw/microorganisms.md5 index 69fa8408..a53b4f90 100644 --- a/data-raw/microorganisms.md5 +++ b/data-raw/microorganisms.md5 @@ -1 +1 @@ -3d92820386230a7ac3c9367ce6d96db9 +aec0e9d495ebee3079f9aab766d7a38f diff --git a/data-raw/microorganisms.parquet b/data-raw/microorganisms.parquet index 7b0de0fe..9a5c2507 100644 Binary files a/data-raw/microorganisms.parquet and b/data-raw/microorganisms.parquet differ diff --git a/data-raw/microorganisms.rds b/data-raw/microorganisms.rds index dd27bf72..2c7e23f0 100644 Binary files a/data-raw/microorganisms.rds and b/data-raw/microorganisms.rds differ diff --git a/data-raw/microorganisms.sas b/data-raw/microorganisms.sas index 41cdd2e7..6b19c01f 100644 Binary files a/data-raw/microorganisms.sas and b/data-raw/microorganisms.sas differ diff --git a/data-raw/microorganisms.sav b/data-raw/microorganisms.sav index 66e5a4d0..80711bdf 100644 Binary files a/data-raw/microorganisms.sav and b/data-raw/microorganisms.sav differ diff --git a/data-raw/microorganisms.xlsx b/data-raw/microorganisms.xlsx index 3f8fcfb3..d7508587 100644 Binary files a/data-raw/microorganisms.xlsx and b/data-raw/microorganisms.xlsx differ diff --git a/data-raw/reproduction_of_microorganisms.R b/data-raw/reproduction_of_microorganisms.R index c25f7cfe..f613006b 100644 --- a/data-raw/reproduction_of_microorganisms.R +++ b/data-raw/reproduction_of_microorganisms.R @@ -1380,6 +1380,9 @@ for (nm in to_restore) { # Save to package --------------------------------------------------------- +# set class if still needed (if you run only this part coming from other scripts) +class(microorganisms$mo) <- c("mo", "character") +microorganisms <- microorganisms %>% arrange(fullname) usethis::use_data(microorganisms, overwrite = TRUE, version = 2, compress = "xz") rm(microorganisms) diff --git a/data/microorganisms.rda b/data/microorganisms.rda index 85757584..11c4818e 100644 Binary files a/data/microorganisms.rda and b/data/microorganisms.rda differ diff --git a/inst/tinytest/test-mo.R b/inst/tinytest/test-mo.R index 1099015e..04a55ae1 100644 --- a/inst/tinytest/test-mo.R +++ b/inst/tinytest/test-mo.R @@ -280,7 +280,7 @@ expect_equal(length(summary(example_isolates$mo)), 6) # WHONET codes and NA/NaN expect_equal( - as.character(as.mo(c("xxx", "na", "nan"), debug = TRUE)), + as.character(as.mo(c("xxx", "na", "nan"))), rep(NA_character_, 3) ) expect_equal(as.character(as.mo("con")), "UNKNOWN")