mirror of
https://github.com/msberends/AMR.git
synced 2025-07-01 23:58:35 +02:00
(v3.0.0.9004) random mic fix
This commit is contained in:
parent
72db2b2562
commit
8fd8ee508f
@ -1,5 +1,5 @@
|
||||
Package: AMR
|
||||
Version: 3.0.0.9003
|
||||
Version: 3.0.0.9004
|
||||
Date: 2025-06-13
|
||||
Title: Antimicrobial Resistance Data Analysis
|
||||
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
||||
|
2
NEWS.md
2
NEWS.md
@ -1,4 +1,4 @@
|
||||
# AMR 3.0.0.9003
|
||||
# AMR 3.0.0.9004
|
||||
|
||||
### New
|
||||
* Integration with the **tidymodels** framework to allow seamless use of MIC and SIR data in modelling pipelines via `recipes`
|
||||
|
@ -88,8 +88,9 @@ random_mic <- function(size = NULL, mo = NULL, ab = NULL, skew = "right", severi
|
||||
out[out == min(out)] <- paste0("<=", out[out == min(out)])
|
||||
}
|
||||
if (stats::runif(1) > 0.5 && length(unique(out)) > 1) {
|
||||
out[out == max(out)] <- paste0(">=", out[out == max(out)])
|
||||
out[out == max(out) & out %unlike% "<="] <- paste0(">=", out[out == max(out) & out %unlike% "<="])
|
||||
}
|
||||
|
||||
return(out)
|
||||
} else {
|
||||
random_exec("MIC", size = size, mo = mo, ab = ab, skew = skew, severity = severity)
|
||||
@ -163,7 +164,7 @@ random_exec <- function(method_type, size, mo = NULL, ab = NULL, skew = "right",
|
||||
out[out == min(out)] <- paste0("<=", out[out == min(out)])
|
||||
}
|
||||
if (stats::runif(1) > 0.5 && length(unique(out)) > 1) {
|
||||
out[out == max(out)] <- paste0(">=", out[out == max(out)])
|
||||
out[out == max(out) & out %unlike% "<="] <- paste0(">=", out[out == max(out) & out %unlike% "<="])
|
||||
}
|
||||
return(as.mic(out))
|
||||
} else if (method_type == "DISK") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user