- Used in 135 countries
Since its first public release in early 2018, this package has been downloaded from 135 countries. Click the map to enlarge and to also see the names of the countries.
+ Used in 135 countries
Since its first public release in early 2018, this package has been downloaded from 135 countries. Click the map to enlarge.
+With AMR
(for R), you’ll always have a knowledgeable microbiologist at your side!
++# AMR works great with dplyr, but it's not required or neccesary +library(AMR) +library(dplyr) + +example_isolates %>% + mutate(mo = mo_fullname(mo)) %>% + filter(mo_is_gram_positive()) %>% + select(mo, carbapenems(), glycopeptides()) +#> NOTE: Using column 'mo' as input for mo_is_gram_positive() +#> Selecting cephalosporins: 'CAZ' (ceftazidime), 'CRO' (ceftriaxone), +#> 'CTX' (cefotaxime), 'CXM' (cefuroxime), +#> 'CZO' (cefazolin), 'FEP' (cefepime), +#> 'FOX' (cefoxitin) +#> Selecting glycopeptides: 'TEC' (teicoplanin), 'VAN' (vancomycin)
With only having defined a filter on Gram-positive micro-organisms (mo_is_gram_positive()
) and a selection of two antibiotic groups (carbapenems()
and glycopeptides()
), the reference data about all bugs and drugs in the AMR
package make sure you get what you meant:
mo | +CAZ | +CRO | +CTX | +CXM | +CZO | +FEP | +FOX | +TEC | +VAN | +
---|---|---|---|---|---|---|---|---|---|
Enterococcus faecalis | +R | +R | +R | +R | +R | +R | +R | ++ | S | +
Enterococcus faecalis | +R | ++ | R | +R | +R | +R | +R | ++ | S | +
Enterococcus faecalis | +R | +R | +R | +R | +R | +R | +R | ++ | S | +
+Streptococcus group B | +R | +S | +S | +S | +S | +S | +S | ++ | S | +
Staphylococcus epidermidis | +R | ++ | + | S | ++ | + | + | + | S | +
Enterococcus faecium | +R | +R | +R | +R | +R | +R | +R | ++ | S | +
Partners
@@ -281,7 +390,7 @@ Since you are one of our users, we would like to know how you use the package an Latest released versionThis package is available here on the official R network (CRAN), which has a peer-reviewed submission process. Install this package in R from CRAN by using the command:
-+install.packages("AMR")It will be downloaded and installed automatically. For RStudio, click on the menu Tools > Install Packages… and then type in “AMR” and press Install.
Note: Not all functions on this website may be available in this latest release. To use all functions and data sets mentioned on this website, install the latest development version.
@@ -290,7 +399,7 @@ Since you are one of our users, we would like to know how you use the package anLatest development version
The latest and unpublished development version can be installed from GitHub using:
-@@ -353,7 +462,7 @@ Since you are one of our users, we would like to know how you use the package an+install.packages("remotes") remotes::install_github("msberends/AMR")
It analyses the data with convenient functions that use well-known methods.
-
-
- Calculate the microbial susceptibility or resistance (and even co-resistance) with the
susceptibility()
andresistance()
functions, or be even more specific with theproportion_R()
,proportion_IR()
,proportion_I()
,proportion_SI()
andproportion_S()
functions. Similarly, the number of isolates can be determined with thecount_resistant()
,count_susceptible()
andcount_all()
functions. All these functions can be used with thedplyr
package (e.g. in conjunction withsummarise()
)
+ - Calculate the microbial susceptibility or resistance (and even co-resistance) with the
susceptibility()
andresistance()
functions, or be even more specific with theproportion_R()
,proportion_IR()
,proportion_I()
,proportion_SI()
andproportion_S()
functions. Similarly, the number of isolates can be determined with thecount_resistant()
,count_susceptible()
andcount_all()
functions. All these functions can be used with thedplyr
package (e.g. in conjunction withsummarise()
) - Plot AMR results with
geom_rsi()
, a function made for theggplot2
package - Predict antimicrobial resistance for the nextcoming years using logistic regression models with the
resistance_predict()
function
NEWS.md
-AMR 1.4.0.9032 Unreleased
+
+
+AMR 1.4.0.9033 Unreleased
-
+
-Last updated: 7 December 2020
+Last updated: 8 December 2020
@@ -496,7 +496,7 @@
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:
-- Function
freq()
that was borrowed from the cleaner
package was removed. Use cleaner::freq()
, or run library("cleaner")
before you use freq()
.
+- Function
freq()
that was borrowed from the cleaner
package was removed. Use cleaner::freq()
, or run library("cleaner")
before you use freq()
.
Printing values of class 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.
All functions from the mo_*
family (like mo_name()
and mo_gramstain()
) are noticeably slower when running on hundreds of thousands of rows.
- For developers: classes
mo
and ab
now both also inherit class character
, to support any data transformation. This change invalidates code that checks for class length == 1.
@@ -824,7 +824,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
#> invalid microorganism code, NA generated
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
@@ -1087,7 +1087,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
The age()
function gained a new parameter exact
to determine ages with decimals
Removed deprecated functions guess_mo()
, guess_atc()
, EUCAST_rules()
, interpretive_reading()
, rsi()
-Frequency tables (freq()
):
+ Frequency tables (freq()
):
speed improvement for microbial IDs
fixed factor level names for R Markdown
@@ -1096,12 +1096,12 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
support for boxplots:
@@ -1111,7 +1111,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
Added ceftazidim intrinsic resistance to Streptococci
Changed default settings for age_groups()
, to let groups of fives and tens end with 100+ instead of 120+
-Fix for freq()
for when all values are NA
+ Fix for freq()
for when all values are NA
Fix for first_isolate()
for when dates are missing
Improved speed of guess_ab_col()
@@ -1343,7 +1343,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
-Frequency tables (freq()
function):
+ Frequency tables (freq()
function):
-
Support for tidyverse quasiquotation! Now you can create frequency tables of function outcomes:
@@ -1352,15 +1352,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))
+ freq(mo_genus(mo))
+AMR 1.4.0.9033 Unreleased
--Last updated: 7 December 2020 +Last updated: 8 December 2020
@@ -496,7 +496,7 @@
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:
-
-
- Function
freq()
that was borrowed from thecleaner
package was removed. Usecleaner::freq()
, or runlibrary("cleaner")
before you usefreq()
.
+ - Function
freq()
that was borrowed from thecleaner
package was removed. Usecleaner::freq()
, or runlibrary("cleaner")
before you usefreq()
. Printing values of classmo
orrsi
in a tibble will no longer be in colour and printingrsi
in a tibble will show the class<ord>
, not<rsi>
anymore. This is purely a visual effect.All functions from themo_*
family (likemo_name()
andmo_gramstain()
) are noticeably slower when running on hundreds of thousands of rows.- For developers: classes
mo
andab
now both also inherit classcharacter
, to support any data transformation. This change invalidates code that checks for class length == 1.
@@ -824,7 +824,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
#> invalid microorganism code, NA generated
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
age()
function gained a new parameter 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
@@ -1096,12 +1096,12 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
support for boxplots:
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()
@@ -1343,7 +1343,7 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
freq()
function):
+freq()
function):
-
Support for tidyverse quasiquotation! Now you can create frequency tables of function outcomes:
@@ -1352,15 +1352,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 parameter header
is now set to TRUE
at default, even for markdown
Using portion_*
functions now throws a warning when total available isolate is below parameter 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
parameter
AI improvements for as.mo
:
Support for types (classes) list and matrix for freq