vignettes/datasets.Rmd
datasets.Rmd
NEWS.md
+ AMR
1.7.0.9000library(AMR)
)Functions random_mic()
, random_disk()
and random_rsi()
for random value generation. The functions random_mic()
and random_disk()
take microorganism names and antibiotic names as input to make generation more realistic.
New argument ampc_cephalosporin_resistance
in eucast_rules()
to correct for AmpC de-repressed cephalosporin-resistant mutants
Support for skimming classes <rsi>
, <mic>
, <disk>
and <mo>
with the skimr
package
Although advertised that this package should work under R 3.0.0, we still had a dependency on R 3.6.0. This is fixed, meaning that our package should now work under R 3.0.0.
Added argument conserve_capped_values
to as.rsi()
for interpreting MIC values - it makes sure that values starting with “<” (but not “<=”) will always return “S” and values starting with “>” (but not “>=”) will always return “R”. The default behaviour of as.rsi()
has not changed, so you need to specifically do as.rsi(..., conserve_capped_values = TRUE)
.
Big speed improvement for using any function on microorganism codes from earlier package versions (prior to AMR
v1.2.0), such as as.mo()
, mo_name()
, first_isolate()
, eucast_rules()
, mdro()
, etc.
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.ggplot_pca()
functionas.mo()
(and consequently all mo_*
functions, that use as.mo()
internally):
AMR
1.0.1Fixed important floating point error for some MIC comparisons in EUCAST 2020 guideline
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
as.mo()
(of which some led to additions to the microorganisms
data set). Many thanks to all contributors that helped improving the algorithms.
Function mo_synonyms()
to get all previously accepted taxonomic names of a microorganism
count_df()
and portion_df()
are now lowercasemdr_tb()
) and added a new vignette about MDR. Read this tutorial here on our website.first_isolate()
where missing species would lead to incorrect FALSEs. This bug was not present in AMR v0.5.0, but was in v0.6.0 and v0.6.1.eucast_rules()
where antibiotics from WHONET software would not be recognisedage()
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
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()
@@ -1440,9 +1456,9 @@ This works for all drug combinations, such as ampicillin/sulbactam, ceftazidime/
AMR
0.6.1eucast_rules()
with verbose = TRUE
New vignettes about how to conduct AMR analysis, predict antimicrobial resistance, use the G-test and more. These are also available (and even easier readable) on our website: https://msberends.gitlab.io/AMR.
eucast_rules()
:
freq()
function):
+freq()
function):
Support for tidyverse quasiquotation! Now you can create frequency tables of function outcomes:
@@ -1664,15 +1680,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
mo_authors
and mo_year
to get specific values about the scientific reference of a taxonomic entryFunctions MDRO
, BRMO
, MRGN
and EUCAST_exceptional_phenotypes
were renamed to mdro
, brmo
, mrgn
and eucast_exceptional_phenotypes
EUCAST_rules
was renamed to eucast_rules
, the old function still exists as a deprecated function
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 (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
:
Renamed septic_patients$sex
to septic_patients$gender
Added three antimicrobial agents to the antibiotics
data set: Terbinafine (D01BA02), Rifaximin (A07AA11) and Isoconazole (D01AC05)
For lists, subsetting is possible:
my_list = list(age = septic_patients$age, gender = septic_patients$gender)
-my_list %>% freq(age)
-my_list %>% freq(gender)
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 vectorresistance_predict
and added more examplestibble
s and data.table
srsi
class for vectors that contain only invalid antimicrobial interpretationsablist
to antibiotics
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml
index 0bc295f2..9faffc34 100644
--- a/docs/pkgdown.yml
+++ b/docs/pkgdown.yml
@@ -12,7 +12,7 @@ articles:
datasets: datasets.html
resistance_predict: resistance_predict.html
welcome_to_AMR: welcome_to_AMR.html
-last_built: 2021-05-26T12:00Z
+last_built: 2021-05-30T20:01Z
urls:
reference: https://msberends.github.io/AMR//reference
article: https://msberends.github.io/AMR//articles
diff --git a/docs/reference/WHOCC.html b/docs/reference/WHOCC.html
index f9b16361..db5d030d 100644
--- a/docs/reference/WHOCC.html
+++ b/docs/reference/WHOCC.html
@@ -82,7 +82,7 @@