vignettes/datasets.Rmd
datasets.Rmd
NEWS.md
- AMR
1.7.1.9024AMR
1.7.1.9025filter_*()
functions (except for filter_first_isolate()
), which were all deprecated in a previous package versionp_symbol()
and all filter_*()
functions (except for filter_first_isolate()
), which were all deprecated in a previous package versionkey_antibiotics()
and key_antibiotics_equal()
functions, which were deprecated and superseded by key_antimicrobials()
and antimicrobials_equal()
ggplot2::ggplot()
generics for classes <mic>
, <disk>
, <rsi>
and <resistance_predict>
as they did not follow the ggplot2
logic. They were replaced with ggplot2::autoplot()
generics.ab_atc()
does not always return a character vector with length 1, and returns a list
if the input is larger than length 1
aminopenicillins()
, antifungals()
, antimycobacterials()
, lincosamides()
, lipoglycopeptides()
, polymyxins()
, quinolones()
, streptogramins()
, trimethoprims()
and ureidopenicillins()
-administrable_per_os()
and administrable_iv()
, which are based on available Defined Daily Doses (DDDs), as defined by the WHOCC. These are ideal for e.g. analysing pathogens in primary care where IV treatment is not an option. They can be combined with other AB selectors, e.g. to select penicillins that are only administrable per os (i.e., orally):+
They now also work in R-3.0 and R-3.1, supporting every version of R since 2013
Added more selectors for antibiotic classes: aminopenicillins()
, antifungals()
, antimycobacterials()
, lincosamides()
, lipoglycopeptides()
, polymyxins()
, quinolones()
, streptogramins()
, trimethoprims()
and ureidopenicillins()
Added specific selectors for certain types for treatment: administrable_per_os()
and administrable_iv()
, which are based on available Defined Daily Doses (DDDs), as defined by the WHOCC. These are ideal for e.g. analysing pathogens in primary care where IV treatment is not an option. They can be combined with other AB selectors, e.g. to select penicillins that are only administrable per os (i.e., orally):
example_isolates[, penicillins() & administrable_per_os()] # base R
example_isolates %>% select(penicillins() & administrable_per_os()) # dplyr
dplyr::filter()
and immediately after in dplyr::select()
)only_treatable
, which defaults to TRUE
and will exclude drugs that are only for laboratory tests and not for treating patients (such as imipenem/EDTA and gentamicin-high)Fix for using selectors multiple times in one call (e.g., using them in dplyr::filter()
and immediately after in dplyr::select()
)
Added argument only_treatable
, which defaults to TRUE
and will exclude drugs that are only for laboratory tests and not for treating patients (such as imipenem/EDTA and gentamicin-high)
mo_gramstain()
) determination of the class Negativicutes within the phylum of Firmicutes - they were considered Gram-positives because of their phylum but are actually Gram-negative. This impacts 137 taxonomic species, genera and families, such as Negativicoccus and Veillonella.antibiotics
data setfirst_isolate()
and key_antimicrobials()
functions has been completely rewritten.betalactams()
as additional antbiotic column selector and function filter_betalactams()
as additional antbiotic column filter. The group of betalactams consists of all carbapenems, cephalosporins and penicillins.ggplot()
method for resistance_predict()
+ggplot()
method for resistance_predict()
Support for custom MDRO guidelines, using the new custom_mdro_guideline()
function, please see mdro()
for additional info
ggplot()
generics for classes <mic>
and <disk>
ggplot()
generics for classes <mic>
and <disk>
Function mo_is_yeast()
, which determines whether a microorganism is a member of the taxonomic class Saccharomycetes or the taxonomic order Saccharomycetales:
@@ -494,7 +488,7 @@
translate
)plot()
and with ggplot2 using ggplot()
on any vector of MIC and disk diffusion valuesplot()
and with ggplot2 using ggplot()
on any vector of MIC and disk diffusion valuesmicroorganisms
data setis.rsi.eligible()
now detects if the column name resembles an antibiotic name or code and now returns TRUE
immediately if the input contains any of the values “R”, “S” or “I”. This drastically improves speed, also for a lot of other functions that rely on automatic determination of antibiotic columns.get_episode()
and is_new_episode()
now support less than a day as value for argument episode_days
(e.g., to include one patient/test per hour)ampc_cephalosporin_resistance
in eucast_rules()
now also applies to value “I” (not only “S”)print()
and summary()
on a Principal Components Analysis object (pca()
) now print additional group info if the original data was grouped using dplyr::group_by()
+print()
and summary()
on a Principal Components Analysis object (pca()
) now print additional group info if the original data was grouped using dplyr::group_by()
guess_ab_col()
. As this also internally improves the reliability of first_isolate()
and mdro()
, this might have a slight impact on the results of those functions.mo_name()
when used in other languages than EnglishFor all function arguments in the code, it is now defined what the exact type of user input should be (inspired by the typed
package). If the user input for a certain function does not meet the requirements for a specific argument (such as the class or length), an informative error will be thrown. This makes the package more robust and the use of it more reproducible and reliable. In total, more than 420 arguments were defined.
Fix for set_mo_source()
, that previously would not remember the file location of the original file
Deprecated function p_symbol()
that not really fits the scope of this package. It will be removed in a future version. See here for the source code to preserve it.
Deprecated function p_symbol()
that not really fits the scope of this package. It will be removed in a future version. See here for the source code to preserve it.
Updated coagulase-negative staphylococci determination with Becker et al. 2020 (PMID 32056452), meaning that the species S. argensis, S. caeli, S. debuckii, S. edaphicus and S. pseudoxylosus are now all considered CoNS
Fix for using argument reference_df
in as.mo()
and mo_*()
functions that contain old microbial codes (from previous package versions)
Fixed a bug where mo_uncertainties()
would not return the results based on the MO matching score
Removed code dependency on all other R packages, making this package fully independent of the development process of others. This is a major code change, but will probably not be noticeable by most users.
Making this package independent of especially the tidyverse (e.g. packages dplyr
and tidyr
) tremendously increases sustainability on the long term, since tidyverse functions change quite often. Good for users, but hard for package maintainers. Most of our functions are replaced with versions that only rely on base R, which keeps this package fully functional for many years to come, without requiring a lot of maintenance to keep up with other packages anymore. Another upside it that this package can now be used with all versions of R since R-3.0.0 (April 2013). Our package is being used in settings where the resources are very limited. Fewer dependencies on newer software is helpful for such settings.
Negative effects of this change are:
-freq()
that was borrowed from the cleaner
package was removed. Use cleaner::freq()
, or run library("cleaner")
before you use freq()
.freq()
that was borrowed from the cleaner
package was removed. Use cleaner::freq()
, or run library("cleaner")
before you use freq()
.mo
or rsi
in a tibble will no longer be in colour and printing rsi
in a tibble will show the class <ord>
, not <rsi>
anymore. This is purely a visual effect.mo_*
family (like mo_name()
and mo_gramstain()
) are noticeably slower when running on hundreds of thousands of rows.mo
and ab
now both also inherit class character
, to support any data transformation. This change invalidates code that checks for class length == 1.p.symbol()
- it was replaced with p_symbol()
+p.symbol()
- it was replaced with p_symbol()
read.4d()
, that was only useful for reading data from an old test database.This is important, because a value like "testvalue"
could never be understood by e.g. mo_name()
, although the class would suggest a valid microbial code.
Function freq()
has moved to a new package, clean
(CRAN link), since creating frequency tables actually does not fit the scope of this package. The freq()
function still works, since it is re-exported from the clean
package (which will be installed automatically upon updating this AMR
package).
Function freq()
has moved to a new package, clean
(CRAN link), since creating frequency tables actually does not fit the scope of this package. The freq()
function still works, since it is re-exported from the clean
package (which will be installed automatically upon updating this AMR
package).
Renamed data set septic_patients
to example_isolates
filter_ab_class()
to be more reliable and to support 5th generation cephalosporinsavailability()
now uses portion_R()
instead of portion_IR()
, to comply with EUCAST insightsage()
and age_groups()
now have a na.rm
argument to remove empty valuesp.symbol()
to p_symbol()
(the former is now deprecated and will be removed in a future version)p.symbol()
to p_symbol()
(the former is now deprecated and will be removed in a future version)x
in age_groups()
will now introduce NA
s and not return an error anymorekey_antibiotics()
on foreign systemsage()
function gained a new argument exact
to determine ages with decimalsguess_mo()
, guess_atc()
, EUCAST_rules()
, interpretive_reading()
, rsi()
freq()
):
+freq()
):
speed improvement for microbial IDs
fixed factor level names for R Markdown
when all values are unique it now shows a message instead of a warning
age_groups()
, to let groups of fives and tens end with 100+ instead of 120+freq()
for when all values are NA
+freq()
for when all values are NA
first_isolate()
for when dates are missingguess_ab_col()
@@ -1565,7 +1559,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
"HIGH S"
will return S
freq()
function):
+freq()
function):
Support for tidyverse quasiquotation! Now you can create frequency tables of function outcomes:
@@ -1574,15 +1568,15 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/ # OLD WAY septic_patients %>% mutate(genus = mo_genus(mo)) %>% - freq(genus) + freq(genus) # NEW WAY septic_patients %>% - freq(mo_genus(mo)) + freq(mo_genus(mo)) # Even supports grouping variables: septic_patients %>% group_by(gender) %>% - freq(mo_genus(mo))
Header info is now available as a list, with the header
function
The argument header
is now set to TRUE
at default, even for markdown
Using portion_*
functions now throws a warning when total available isolate is below argument minimum
Functions as.mo
, as.rsi
, as.mic
, as.atc
and freq
will not set package name as attribute anymore
Frequency tables - freq()
:
Frequency tables - freq()
:
Support for grouping variables, test with:
+ freq(gender)Support for (un)selecting columns:
Check for hms::is.hms
Removed diacritics from all authors (columns microorganisms$ref
and microorganisms.old$ref
) to comply with CRAN policy to only allow ASCII characters
Fix for mo_property
not working properly
Fix for eucast_rules
where some Streptococci would become ceftazidime R in EUCAST rule 4.5
Support for named vectors of class mo
, useful for top_freq()
Support for named vectors of class mo
, useful for top_freq()
ggplot_rsi
and scale_y_percent
have breaks
argument
AI improvements for as.mo
:
For lists, subsetting is possible:
my_list = list(age = septic_patients$age, gender = septic_patients$gender)
-my_list %>% freq(age)
-my_list %>% freq(gender)
freq
):
rsi
(antimicrobial resistance) to use as inputtable
to use as input: freq(table(x, y))
+table
to use as input: freq(table(x, y))
hist
and plot
to use a frequency table as input: hist(freq(df$age))
as.vector
, as.data.frame
, as_tibble
and format
freq(mydata, mycolumn)
is the same as mydata %>% freq(mycolumn)
+freq(mydata, mycolumn)
is the same as mydata %>% freq(mycolumn)
top_freq
function to return the top/below n items as vectorThese functions are so-called 'Deprecated'. They will be removed in a future release. Using the functions will give a warning with the name of the function it has been replaced by (if there is one).
-p_symbol(p, emptychar = " ")
All antibiotic class selectors (such as carbapenems()
, aminoglycosides()
) can now be used for filtering as well, making all their accompanying filter_*()
functions redundant (such as filter_carbapenems()
, filter_aminoglycosides()
).
Some pages about our package and its external sources. Be sure to read our How To’s for more information about how to work with functions in this package.
-The AMR
Package
Data Set with 2,000 Example Isolates
Data Set with 70,026 Microorganisms
Data Set with 5,605 Common Microorganism Codes
Data Set with Previously Accepted Taxonomic Names
Data Sets with 558 Antimicrobials
Data Set with Bacterial Intrinsic Resistance
Data Set with Treatment Dosages as Defined by EUCAST
The Catalogue of Life
Version info of included Catalogue of Life
WHOCC: WHO Collaborating Centre for Drug Statistics Methodology
Lifecycles of Functions in the AMR
Package
Data Set with Unclean Data
Data Set for R/SI Interpretation
Data Set with 500 Isolates - WHONET Example
Guess Antibiotic Column
Some pages about our package and its external sources. Be sure to read our How To’s for more information about how to work with functions in this package.
+The AMR
Package
Data Set with 2,000 Example Isolates
Data Set with 70,026 Microorganisms
Data Set with 5,605 Common Microorganism Codes
Data Set with Previously Accepted Taxonomic Names
Data Sets with 558 Antimicrobials
Data Set with Bacterial Intrinsic Resistance
Data Set with Treatment Dosages as Defined by EUCAST
The Catalogue of Life
Version info of included Catalogue of Life
WHOCC: WHO Collaborating Centre for Drug Statistics Methodology
Lifecycles of Functions in the AMR
Package
Data Set with Unclean Data
Data Set for R/SI Interpretation
Data Set with 500 Isolates - WHONET Example
Deprecated Functions