1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-12 22:21:52 +02:00

fix antibiotics error

This commit is contained in:
2022-10-30 21:05:46 +01:00
parent d40e0ef20b
commit 9444ed6d1d
37 changed files with 86 additions and 97 deletions

View File

@ -24,7 +24,7 @@ utils::file.edit("~/.Rprofile")
# Add custom antibiotic codes:
library(AMR)
add_custom_antimicrobials(
data.frame(ab = "TEST",
data.frame(ab = "TESTAB",
name = "Test Antibiotic",
group = "Test Group")
)
@ -37,14 +37,14 @@ Use \code{\link[=clear_custom_antimicrobials]{clear_custom_antimicrobials()}} to
# returns NA and throws a warning (which is now suppressed):
suppressWarnings(
as.ab("test")
as.ab("testab")
)
# now add a custom entry - it will be considered by as.ab() and
# all ab_*() functions
add_custom_antimicrobials(
data.frame(
ab = "TEST",
ab = "TESTAB",
name = "Test Antibiotic",
# you can add any property present in the
# 'antibiotics' data set, such as 'group':
@ -52,12 +52,12 @@ add_custom_antimicrobials(
)
)
# "test" is now a new antibiotic:
as.ab("test")
ab_name("test")
ab_group("test")
# "testab" is now a new antibiotic:
as.ab("testab")
ab_name("testab")
ab_group("testab")
ab_info("test")
ab_info("testab")
# Add Co-fluampicil, which is one of the many J01CR50 codes, see
@ -75,7 +75,7 @@ ab_name("J01CR50")
# even antibiotic selectors work
x <- data.frame(
random_column = "test",
random_column = "some value",
coflu = as.rsi("S"),
ampicillin = as.rsi("R")
)