Note: values on this page will change with every
website update since they are based on randomly created values and the
page was written in R
Markdown. However, the methodology remains unchanged. This page was
generated on 14 March 2022.
+=======
+
Note: values on this page will change with every website update since they are based on randomly created values and the page was written in R Markdown. However, the methodology remains unchanged. This page was generated on 12 March 2022.
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
Introduction
-
Conducting AMR data analysis unfortunately requires in-depth
-knowledge from different scientific fields, which makes it hard to do
-right. At least, it requires:
+
Conducting AMR data analysis unfortunately requires in-depth knowledge from different scientific fields, which makes it hard to do right. At least, it requires:
Good questions (always start with those!)
-
A thorough understanding of (clinical) epidemiology, to understand
-the clinical and epidemiological relevance and possible bias of
-results
-
A thorough understanding of (clinical) microbiology/infectious
-diseases, to understand which microorganisms are causal to which
-infections and the implications of pharmaceutical treatment, as well as
-understanding intrinsic and acquired microbial resistance
-
Experience with data analysis with microbiological tests and their
-results, to understand the determination and limitations of MIC values
-and their interpretations to RSI values
-
Availability of the biological taxonomy of microorganisms and
-probably normalisation factors for pharmaceuticals, such as defined
-daily doses (DDD)
-
Available (inter-)national guidelines, and profound methods to apply
-them
+
A thorough understanding of (clinical) epidemiology, to understand the clinical and epidemiological relevance and possible bias of results
+
A thorough understanding of (clinical) microbiology/infectious diseases, to understand which microorganisms are causal to which infections and the implications of pharmaceutical treatment, as well as understanding intrinsic and acquired microbial resistance
+
Experience with data analysis with microbiological tests and their results, to understand the determination and limitations of MIC values and their interpretations to RSI values
+
Availability of the biological taxonomy of microorganisms and probably normalisation factors for pharmaceuticals, such as defined daily doses (DDD)
+
Available (inter-)national guidelines, and profound methods to apply them
-
Of course, we cannot instantly provide you with knowledge and
-experience. But with this AMR package, we aimed at
-providing (1) tools to simplify antimicrobial resistance data cleaning,
-transformation and analysis, (2) methods to easily incorporate
-international guidelines and (3) scientifically reliable reference data,
-including the requirements mentioned above.
-
The AMR package enables standardised and reproducible
-AMR data analysis, with the application of evidence-based rules,
-determination of first isolates, translation of various codes for
-microorganisms and antimicrobial agents, determination of (multi-drug)
-resistant microorganisms, and calculation of antimicrobial resistance,
-prevalence and future trends.
+
Of course, we cannot instantly provide you with knowledge and experience. But with this AMR package, we aimed at providing (1) tools to simplify antimicrobial resistance data cleaning, transformation and analysis, (2) methods to easily incorporate international guidelines and (3) scientifically reliable reference data, including the requirements mentioned above.
+
The AMR package enables standardised and reproducible AMR data analysis, with the application of evidence-based rules, determination of first isolates, translation of various codes for microorganisms and antimicrobial agents, determination of (multi-drug) resistant microorganisms, and calculation of antimicrobial resistance, prevalence and future trends.
Preparation
-
For this tutorial, we will create fake demonstration data to work
-with.
-
You can skip to Cleaning the data if
-you already have your own data ready. If you start your analysis, try to
-make the structure of your data generally look like this:
+
For this tutorial, we will create fake demonstration data to work with.
+
You can skip to Cleaning the data if you already have your own data ready. If you start your analysis, try to make the structure of your data generally look like this:
date
@@ -261,21 +243,33 @@ make the structure of your data generally look like this:
+<<<<<<< HEAD
2022-03-14
+=======
+
2022-03-12
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
abcd
Escherichia coli
S
S
+<<<<<<< HEAD
2022-03-14
+=======
+
2022-03-12
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
abcd
Escherichia coli
S
R
+<<<<<<< HEAD
2022-03-14
+=======
+
2022-03-12
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
efgh
Escherichia coli
R
@@ -286,13 +280,8 @@ make the structure of your data generally look like this:
Needed R packages
-
As with many uses in R, we need some additional packages for AMR data
-analysis. Our package works closely together with the tidyverse packagesdplyr and ggplot2 by
-RStudio. The tidyverse tremendously improves the way we conduct data
-science - it allows for a very natural way of writing syntaxes and
-creating beautiful plots in R.
-
We will also use the cleaner package, that can be used
-for cleaning data and creating frequency tables.
+
As with many uses in R, we need some additional packages for AMR data analysis. Our package works closely together with the tidyverse packagesdplyr and ggplot2 by RStudio. The tidyverse tremendously improves the way we conduct data science - it allows for a very natural way of writing syntaxes and creating beautiful plots in R.
+
We will also use the cleaner package, that can be used for cleaning data and creating frequency tables.
We will create some fake example data to use for analysis. For AMR
-data analysis, we need at least: a patient ID, name or code of a
-microorganism, a date and antimicrobial results (an antibiogram). It
-could also include a specimen type (e.g. to filter on blood or urine),
-the ward type (e.g. to filter on ICUs).
-
With additional columns (like a hospital name, the patients gender of
-even [well-defined] clinical properties) you can do a comparative
-analysis, as this tutorial will demonstrate too.
+
We will create some fake example data to use for analysis. For AMR data analysis, we need at least: a patient ID, name or code of a microorganism, a date and antimicrobial results (an antibiogram). It could also include a specimen type (e.g. to filter on blood or urine), the ward type (e.g. to filter on ICUs).
+
With additional columns (like a hospital name, the patients gender of even [well-defined] clinical properties) you can do a comparative analysis, as this tutorial will demonstrate too.
Patients
To start with patients, we need a unique list of patients.
The LETTERS object is available in R - it’s a vector
-with 26 characters: A to Z. The
-patients object we just created is now a vector of length
-260, with values (patient IDs) varying from A1 to
-Z10. Now we we also set the gender of our patients, by
-putting the ID and the gender in a table:
+
The LETTERS object is available in R - it’s a vector with 26 characters: A to Z. The patients object we just created is now a vector of length 260, with values (patient IDs) varying from A1 to Z10. Now we we also set the gender of our patients, by putting the ID and the gender in a table:
patients_table<-data.frame(patient_id =patients,
gender =c(rep("M", 135),
@@ -335,19 +313,14 @@ putting the ID and the gender in a table:
Dates
-
Let’s pretend that our data consists of blood cultures isolates from
-between 1 January 2010 and 1 January 2018.
+
Let’s pretend that our data consists of blood cultures isolates from between 1 January 2010 and 1 January 2018.
This dates object now contains all days in our date
-range.
+
This dates object now contains all days in our date range.
Microorganisms
-
For this tutorial, we will uses four different microorganisms:
-Escherichia coli, Staphylococcus aureus,
-Streptococcus pneumoniae, and Klebsiella
-pneumoniae:
+
For this tutorial, we will uses four different microorganisms: Escherichia coli, Staphylococcus aureus, Streptococcus pneumoniae, and Klebsiella pneumoniae:
Using the sample() function, we can randomly select
-items from all objects we defined earlier. To let our fake data reflect
-reality a bit, we will also approximately define the probabilities of
-bacteria and the antibiotic results, using the random_rsi()
-function.
+
Using the sample() function, we can randomly select items from all objects we defined earlier. To let our fake data reflect reality a bit, we will also approximately define the probabilities of bacteria and the antibiotic results, using the random_rsi() function.
We also created a package dedicated to data cleaning and checking,
-called the cleaner package. It freq() function
-can be used to create frequency tables.
+
We also created a package dedicated to data cleaning and checking, called the cleaner package. It freq() function can be used to create frequency tables.
So, we can draw at least two conclusions immediately. From a data
-scientists perspective, the data looks clean: only values M
-and F. From a researchers perspective: there are slightly
-more men. Nothing we didn’t already know.
-
The data is already quite clean, but we still need to transform some
-variables. The bacteria column now consists of text, and we
-want to add more variables based on microbial IDs later on. So, we will
-transform this column to valid IDs. The mutate() function
-of the dplyr package makes this really easy:
+
So, we can draw at least two conclusions immediately. From a data scientists perspective, the data looks clean: only values M and F. From a researchers perspective: there are slightly more men. Nothing we didn’t already know.
+
The data is already quite clean, but we still need to transform some variables. The bacteria column now consists of text, and we want to add more variables based on microbial IDs later on. So, we will transform this column to valid IDs. The mutate() function of the dplyr package makes this really easy:
We also want to transform the antibiotics, because in real life data
-we don’t know if they are really clean. The as.rsi()
-function ensures reliability and reproducibility in these kind of
-variables. The is.rsi.eligible() can check which columns
-are probably columns with R/SI test results. Using mutate()
-and across(), we can apply the transformation to the formal
-<rsi> class:
+
We also want to transform the antibiotics, because in real life data we don’t know if they are really clean. The as.rsi() function ensures reliability and reproducibility in these kind of variables. The is.rsi.eligible() can check which columns are probably columns with R/SI test results. Using mutate() and across(), we can apply the transformation to the formal <rsi> class:
Finally, we will apply EUCAST
-rules on our antimicrobial results. In Europe, most medical
-microbiological laboratories already apply these rules. Our package
-features their latest insights on intrinsic resistance and exceptional
-phenotypes. Moreover, the eucast_rules() function can also
-apply additional rules, like forcing
-ampicillin = R when
-amoxicillin/clavulanic acid = R.
-
Because the amoxicillin (column AMX) and
-amoxicillin/clavulanic acid (column AMC) in our data were
-generated randomly, some rows will undoubtedly contain AMX = S and AMC =
-R, which is technically impossible. The eucast_rules()
-fixes this:
+
Finally, we will apply EUCAST rules on our antimicrobial results. In Europe, most medical microbiological laboratories already apply these rules. Our package features their latest insights on intrinsic resistance and exceptional phenotypes. Moreover, the eucast_rules() function can also apply additional rules, like forcing ampicillin = R when amoxicillin/clavulanic acid = R.
+
Because the amoxicillin (column AMX) and amoxicillin/clavulanic acid (column AMC) in our data were generated randomly, some rows will undoubtedly contain AMX = S and AMC = R, which is technically impossible. The eucast_rules() fixes this:
We also need to know which isolates we can actually use for
-analysis.
-
To conduct an analysis of antimicrobial resistance, you must only include the first
-isolate of every patient per episode (Hindler et al., Clin
-Infect Dis. 2007). If you would not do this, you could easily get an
-overestimate or underestimate of the resistance of an antibiotic.
-Imagine that a patient was admitted with an MRSA and that it was found
-in 5 different blood cultures the following weeks (yes, some countries
-like the Netherlands have these blood drawing policies). The resistance
-percentage of oxacillin of all isolates would be overestimated, because
-you included this MRSA more than once. It would clearly be selection
-bias.
-
The Clinical and Laboratory Standards Institute (CLSI) appoints this
-as follows:
+
We also need to know which isolates we can actually use for analysis.
+
To conduct an analysis of antimicrobial resistance, you must only include the first isolate of every patient per episode (Hindler et al., Clin Infect Dis. 2007). If you would not do this, you could easily get an overestimate or underestimate of the resistance of an antibiotic. Imagine that a patient was admitted with an MRSA and that it was found in 5 different blood cultures the following weeks (yes, some countries like the Netherlands have these blood drawing policies). The resistance percentage of oxacillin of all isolates would be overestimated, because you included this MRSA more than once. It would clearly be selection bias.
+
The Clinical and Laboratory Standards Institute (CLSI) appoints this as follows:
-
(…) When preparing a cumulative antibiogram to guide clinical
-decisions about empirical antimicrobial therapy of initial infections,
-only the first isolate of a given species per patient, per
-analysis period (eg, one year) should be included, irrespective of body
-site, antimicrobial susceptibility profile, or other phenotypical
-characteristics (eg, biotype). The first isolate is easily
-identified, and cumulative antimicrobial susceptibility test data
-prepared using the first isolate are generally comparable to cumulative
-antimicrobial susceptibility test data calculated by other methods,
-providing duplicate isolates are excluded. M39-A4
-Analysis and Presentation of Cumulative Antimicrobial Susceptibility
-Test Data, 4th Edition. CLSI, 2014. Chapter 6.4
+
(…) When preparing a cumulative antibiogram to guide clinical decisions about empirical antimicrobial therapy of initial infections, only the first isolate of a given species per patient, per analysis period (eg, one year) should be included, irrespective of body site, antimicrobial susceptibility profile, or other phenotypical characteristics (eg, biotype). The first isolate is easily identified, and cumulative antimicrobial susceptibility test data prepared using the first isolate are generally comparable to cumulative antimicrobial susceptibility test data calculated by other methods, providing duplicate isolates are excluded. M39-A4 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition. CLSI, 2014. Chapter 6.4
-
This AMR package includes this methodology with the
-first_isolate() function and is able to apply the four
-different methods as defined by Hindler
-et al. in 2007: phenotype-based, episode-based,
-patient-based, isolate-based. The right method depends on your goals and
-analysis, but the default phenotype-based method is in any case the
-method to properly correct for most duplicate isolates. This method also
-takes into account the antimicrobial susceptibility test results using
-all_microbials(). Read more about the methods on the
-first_isolate() page.
+
This AMR package includes this methodology with the first_isolate() function and is able to apply the four different methods as defined by Hindler et al. in 2007: phenotype-based, episode-based, patient-based, isolate-based. The right method depends on your goals and analysis, but the default phenotype-based method is in any case the method to properly correct for most duplicate isolates. This method also takes into account the antimicrobial susceptibility test results using all_microbials(). Read more about the methods on the first_isolate() page.
The outcome of the function can easily be added to our data:
data<-data%>%
@@ -630,11 +599,17 @@ takes into account the antimicrobial susceptibility test results using
# ℹ Using column 'patient_id' as input for `col_patient_id`.# Basing inclusion on all antimicrobial results, using a points threshold of# 2
+<<<<<<< HEAD
# => Found 10,616 'phenotype-based' first isolates (53.1% of total where a# microbial ID was available)
So only 53.1% is suitable for resistance analysis! We can now filter
on it with the filter() function, also from the
dplyr package:
+=======
+# => Found 10,541 'phenotype-based' first isolates (52.7% of total where a
+# microbial ID was available)
+
So only 52.7% is suitable for resistance analysis! We can now filter on it with the filter() function, also from the dplyr package:
You might want to start by getting an idea of how the data is
-distributed. It’s an important start, because it also decides how you
-will continue your analysis. Although this package contains a convenient
-function to make frequency tables, exploratory data analysis (EDA) is
-not the primary scope of this package. Use a package like DataExplorer
-for that, or read the free online book Exploratory Data Analysis
-with R by Roger D. Peng.
+
You might want to start by getting an idea of how the data is distributed. It’s an important start, because it also decides how you will continue your analysis. Although this package contains a convenient function to make frequency tables, exploratory data analysis (EDA) is not the primary scope of this package. Use a package like DataExplorer for that, or read the free online book Exploratory Data Analysis with R by Roger D. Peng.
Dispersion of species
-
To just get an idea how the species are distributed, create a
-frequency table with our freq() function. We created the
-genus and species column earlier based on the
-microbial ID. With paste(), we can concatenate them
-together.
-
The freq() function can be used like the base R language
-was intended:
+
To just get an idea how the species are distributed, create a frequency table with our freq() function. We created the genus and species column earlier based on the microbial ID. With paste(), we can concatenate them together.
+
The freq() function can be used like the base R language was intended:
@@ -940,9 +1021,30 @@ antibiotic class they are in:
TRUE
+<<<<<<< HEAD
2012-06-14
G7
Hospital B
+=======
+
2011-11-15
+
J9
+
Hospital B
+
B_ESCHR_COLI
+
S
+
S
+
S
+
R
+
M
+
Gram-negative
+
Escherichia
+
coli
+
TRUE
+
+
+
2010-10-03
+
D8
+
Hospital C
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
B_STRPT_PNMN
R
R
@@ -954,12 +1056,21 @@ antibiotic class they are in:
pneumoniae
TRUE
+<<<<<<< HEAD
2016-05-08
K4
Hospital D
B_STRPT_PNMN
S
+=======
+
+
2010-05-24
+
E1
+
Hospital B
+
B_ESCHR_COLI
+
R
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
S
S
R
@@ -969,6 +1080,7 @@ antibiotic class they are in:
pneumoniae
TRUE
+<<<<<<< HEAD
2015-03-03
G4
@@ -989,21 +1101,26 @@ antibiotic class they are in:
D1
Hospital A
B_STRPT_PNMN
+=======
+
+
2010-08-26
+
D4
+
Hospital A
+
B_ESCHR_COLI
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
S
S
S
R
M
-
Gram-positive
-
Streptococcus
-
pneumoniae
+
Gram-negative
+
Escherichia
+
coli
TRUE
-
If you want to get a quick glance of the number of isolates in
-different bug/drug combinations, you can use the
-bug_drug_combinations() function:
+
If you want to get a quick glance of the number of isolates in different bug/drug combinations, you can use the bug_drug_combinations() function:
data_1st%>%bug_drug_combinations()%>%
@@ -1022,50 +1139,90 @@ different bug/drug combinations, you can use the
E. coli
AMX
+<<<<<<< HEAD
2205
120
2348
4673
+=======
+
2154
+
135
+
2286
+
4575
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
E. coli
AMC
+<<<<<<< HEAD
3462
158
1053
4673
+=======
+
3356
+
158
+
1061
+
4575
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
E. coli
CIP
+<<<<<<< HEAD
3424
0
1249
4673
+=======
+
3342
+
0
+
1233
+
4575
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
E. coli
GEN
+<<<<<<< HEAD
4079
0
594
4673
+=======
+
4034
+
0
+
541
+
4575
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
K. pneumoniae
AMX
0
0
+<<<<<<< HEAD
1165
1165
+=======
+
1157
+
1157
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
K. pneumoniae
AMC
+<<<<<<< HEAD
940
45
180
1165
+=======
+
887
+
46
+
224
+
1157
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
@@ -1088,68 +1245,81 @@ different bug/drug combinations, you can use the
E. coli
GEN
+<<<<<<< HEAD
4079
0
594
4673
+=======
+
4034
+
0
+
541
+
4575
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
K. pneumoniae
GEN
+<<<<<<< HEAD
1058
0
107
1165
+=======
+
1050
+
0
+
107
+
1157
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
S. aureus
GEN
+<<<<<<< HEAD
2429
0
281
2710
+=======
+
2386
+
0
+
297
+
2683
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
S. pneumoniae
GEN
0
0
+<<<<<<< HEAD
2068
2068
+=======
+
2126
+
2126
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
-
This will only give you the crude numbers in the data. To calculate
-antimicrobial resistance in a more sensible way, also by correcting for
-too few results, we use the resistance() and
-susceptibility() functions.
+
This will only give you the crude numbers in the data. To calculate antimicrobial resistance in a more sensible way, also by correcting for too few results, we use the resistance() and susceptibility() functions.
All these functions contain a minimum argument, denoting
-the minimum required number of test results for returning a value. These
-functions will otherwise return NA. The default is
-minimum = 30, following the CLSI
-M39-A4 guideline for applying microbial epidemiology.
-
As per the EUCAST guideline of 2019, we calculate resistance as the
-proportion of R (proportion_R(), equal to
-resistance()) and susceptibility as the proportion of S and
-I (proportion_SI(), equal to
-susceptibility()). These functions can be used on their
-own:
All these functions contain a minimum argument, denoting the minimum required number of test results for returning a value. These functions will otherwise return NA. The default is minimum = 30, following the CLSI M39-A4 guideline for applying microbial epidemiology.
+
As per the EUCAST guideline of 2019, we calculate resistance as the proportion of R (proportion_R(), equal to resistance()) and susceptibility as the proportion of S and I (proportion_SI(), equal to susceptibility()). These functions can be used on their own:
data_1st%>%resistance(AMX)
+<<<<<<< HEAD
# [1] 0.5451206
Or can be used in conjunction with group_by() and
summarise(), both from the dplyr package:
+=======
+# [1] 0.5432122
+
Or can be used in conjunction with group_by() and summarise(), both from the dplyr package:
Of course it would be very convenient to know the number of isolates
-responsible for the percentages. For that purpose the
-n_rsi() can be used, which works exactly like
-n_distinct() from the dplyr package. It counts
-all isolates available for every group (i.e. values S, I or R):
+
Of course it would be very convenient to know the number of isolates responsible for the percentages. For that purpose the n_rsi() can be used, which works exactly like n_distinct() from the dplyr package. It counts all isolates available for every group (i.e. values S, I or R):
data_1st%>%group_by(hospital)%>%
@@ -1197,6 +1379,7 @@ all isolates available for every group (i.e. values S, I or R):
Hospital A
+<<<<<<< HEAD
0.5451684
3177
@@ -1214,12 +1397,29 @@ all isolates available for every group (i.e. values S, I or R):
Hospital D
0.5511069
2123
+=======
+
0.5326923
+
3120
+
+
+
Hospital B
+
0.5487608
+
3712
+
+
+
Hospital C
+
0.5426866
+
1675
+
+
+
Hospital D
+
0.5496559
+
2034
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
-
These functions can also be used to get the proportion of multiple
-antibiotics, to calculate empiric susceptibility of combination
-therapies very easily:
+
These functions can also be used to get the proportion of multiple antibiotics, to calculate empiric susceptibility of combination therapies very easily:
data_1st%>%group_by(genus)%>%
@@ -1236,6 +1436,7 @@ therapies very easily:
Escherichia
+<<<<<<< HEAD
0.7746630
0.8728868
0.9779585
@@ -1257,13 +1458,33 @@ therapies very easily:
0.5357834
0.0000000
0.5357834
+=======
+
0.7680874
+
0.8817486
+
0.9803279
+
+
+
Klebsiella
+
0.8063959
+
0.9075194
+
0.9732066
+
+
+
Staphylococcus
+
0.7968692
+
0.8893030
+
0.9776370
+
+
+
Streptococcus
+
0.5371590
+
0.0000000
+
0.5371590
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
-
Or if you are curious for the resistance within certain antibiotic
-classes, use a antibiotic class selector such as
-penicillins(), which automatically will include the columns
-AMX and AMC of our data:
+
Or if you are curious for the resistance within certain antibiotic classes, use a antibiotic class selector such as penicillins(), which automatically will include the columns AMX and AMC of our data:
data_1st%>%# group by hospital
@@ -1284,6 +1505,7 @@ classes, use a antibiotic class selector such as
Hospital A
+<<<<<<< HEAD
54.5%
26.5%
@@ -1301,11 +1523,29 @@ classes, use a antibiotic class selector such as
Hospital D
55.1%
26.4%
+=======
+
53.3%
+
25.1%
+
+
+
Hospital B
+
54.9%
+
28.0%
+
+
+
Hospital C
+
54.3%
+
27.9%
+
+
+
Hospital D
+
55.0%
+
25.8%
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
-
To make a transition to the next part, let’s see how differences in
-the previously calculated combination therapies could be plotted:
+
To make a transition to the next part, let’s see how differences in the previously calculated combination therapies could be plotted:
data_1st%>%group_by(genus)%>%
@@ -1323,10 +1563,7 @@ the previously calculated combination therapies could be plotted:
Plots
-
To show results in plots, most R users would nowadays use the
-ggplot2 package. This package lets you create plots in
-layers. You can read more about it on their website. A quick
-example would look like these syntaxes:
+
To show results in plots, most R users would nowadays use the ggplot2 package. This package lets you create plots in layers. You can read more about it on their website. A quick example would look like these syntaxes:
ggplot(data =a_data_set,
mapping =aes(x =year,
@@ -1340,21 +1577,13 @@ example would look like these syntaxes:
# or as short as:ggplot(a_data_set)+geom_bar(aes(year))
-
The AMR package contains functions to extend this
-ggplot2 package, for example geom_rsi(). It
-automatically transforms data with count_df() or
-proportion_df() and show results in stacked bars. Its
-simplest and shortest example:
+
The AMR package contains functions to extend this ggplot2 package, for example geom_rsi(). It automatically transforms data with count_df() or proportion_df() and show results in stacked bars. Its simplest and shortest example:
Omit the translate_ab = FALSE to have the antibiotic
-codes (AMX, AMC, CIP, GEN) translated to official WHO names
-(amoxicillin, amoxicillin/clavulanic acid, ciprofloxacin,
-gentamicin).
-
If we group on e.g. the genus column and add some
-additional functions from our package, we can create this:
+
Omit the translate_ab = FALSE to have the antibiotic codes (AMX, AMC, CIP, GEN) translated to official WHO names (amoxicillin, amoxicillin/clavulanic acid, ciprofloxacin, gentamicin).
+
If we group on e.g. the genus column and add some additional functions from our package, we can create this:
# group the data on `genus`ggplot(data_1st%>%group_by(genus))+
@@ -1377,8 +1606,7 @@ additional functions from our package, we can create this:
# (is now y axis because we turned the plot)theme(axis.text.y =element_text(face ="italic"))
-
To simplify this, we also created the ggplot_rsi()
-function, which combines almost all above functions:
+
To simplify this, we also created the ggplot_rsi() function, which combines almost all above functions:
data_1st%>%group_by(genus)%>%
@@ -1391,17 +1619,13 @@ function, which combines almost all above functions:
Plotting MIC and disk diffusion values
-
The AMR package also extends the plot() and
-ggplot2::autoplot() functions for plotting minimum
-inhibitory concentrations (MIC, created with as.mic()) and
-disk diffusion diameters (created with as.disk()).
-
With the random_mic() and random_disk()
-functions, we can generate sampled values for the new data types (S3
-classes) <mic> and <disk>:
+
The AMR package also extends the plot() and ggplot2::autoplot() functions for plotting minimum inhibitory concentrations (MIC, created with as.mic()) and disk diffusion diameters (created with as.disk()).
+
With the random_mic() and random_disk() functions, we can generate sampled values for the new data types (S3 classes) <mic> and <disk>:
@@ -1422,17 +1660,11 @@ classes) <mic> and <disk>:
# ggplot2:autoplot(mic_values)
-
But we could also be more specific, by generating MICs that are
-likely to be found in E. coli for ciprofloxacin:
+
But we could also be more specific, by generating MICs that are likely to be found in E. coli for ciprofloxacin:
mic_values<-random_mic(size =100, mo ="E. coli", ab ="cipro")
-
For the plot() and autoplot() function, we
-can define the microorganism and an antimicrobial agent the same way.
-This will add the interpretation of those values according to a chosen
-guidelines (defaults to the latest EUCAST guideline).
-
Default colours are colour-blind friendly, while maintaining the
-convention that e.g. ‘susceptible’ should be green and ‘resistant’
-should be red:
+
For the plot() and autoplot() function, we can define the microorganism and an antimicrobial agent the same way. This will add the interpretation of those values according to a chosen guidelines (defaults to the latest EUCAST guideline).
+
Default colours are colour-blind friendly, while maintaining the convention that e.g. ‘susceptible’ should be green and ‘resistant’ should be red:
# base R:plot(mic_values, mo ="E. coli", ab ="cipro")
@@ -1441,25 +1673,29 @@ should be red:
# ggplot2:autoplot(mic_values, mo ="E. coli", ab ="cipro")
-
For disk diffusion values, there is not much of a difference in
-plotting:
+
For disk diffusion values, there is not much of a difference in plotting:
# base R:plot(disk_values, mo ="E. coli", ab ="cipro")
-
And when using the ggplot2 package, but now choosing the
-latest implemented CLSI guideline (notice that the EUCAST-specific term
-“Susceptible, incr. exp.” has changed to “Intermediate”):
+
And when using the ggplot2 package, but now choosing the latest implemented CLSI guideline (notice that the EUCAST-specific term “Susceptible, incr. exp.” has changed to “Intermediate”):
autoplot(disk_values,
mo ="E. coli",
@@ -1471,14 +1707,8 @@ latest implemented CLSI guideline (notice that the EUCAST-specific term
Independence test
-
The next example uses the example_isolates data set.
-This is a data set included with this package and contains 2,000
-microbial isolates with their full antibiograms. It reflects reality and
-can be used to practice AMR data analysis.
-
We will compare the resistance to fosfomycin (column
-FOS) in hospital A and D. The input for the
-fisher.test() can be retrieved with a transformation like
-this:
+
The next example uses the example_isolates data set. This is a data set included with this package and contains 2,000 microbial isolates with their full antibiograms. It reflects reality and can be used to practice AMR data analysis.
+
We will compare the resistance to fosfomycin (column FOS) in hospital A and D. The input for the fisher.test() can be retrieved with a transformation like this:
# use package 'tidyr' to pivot data:library(tidyr)
@@ -1512,9 +1742,7 @@ this:
# sample estimates:# odds ratio # 0.4488318
-
As can be seen, the p value is 0.031, which means that the fosfomycin
-resistance found in isolates from patients in hospital A and D are
-really different.
+
As can be seen, the p value is 0.031, which means that the fosfomycin resistance found in isolates from patients in hospital A and D are really different.
diff --git a/docs/articles/MDR.html b/docs/articles/MDR.html
index d6bd8507..6da37e3d 100644
--- a/docs/articles/MDR.html
+++ b/docs/articles/MDR.html
@@ -44,7 +44,11 @@
AMR (for R)
+<<<<<<< HEAD
1.8.1
+=======
+ 1.8.0.9005
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
@@ -185,7 +189,7 @@
-
+
How to determine multi-drug resistance
@@ -343,6 +347,7 @@ on this data set, we get:
# Table 5 - Acinetobacter spp.... OK.# Warning: in `mdro()`: NA introduced for isolates where the available percentage of# antimicrobial classes was below 50% (set with `pct_required_classes`)
+<<<<<<< HEAD
Only results with ‘R’ are considered as resistance. Use
combine_SI = FALSE to also consider ‘I’ as resistance.
Determining multidrug-resistant organisms (MDRO), according to:
@@ -352,6 +357,10 @@ standard definitions for acquired resistance. Author(s): Magiorakos AP,
Srinivasan A, Carey RB, …, Vatopoulos A, Weber JT, Monnet DL Source:
Clinical Microbiology and Infection 18:3, 2012; doi:
10.1111/j.1469-0691.2011.03570.x
+=======
+
Only results with ‘R’ are considered as resistance. Use combine_SI = FALSE to also consider ‘I’ as resistance.
+
Determining multidrug-resistant organisms (MDRO), according to: Guideline: Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance. Author(s): Magiorakos AP, Srinivasan A, Carey RB, …, Vatopoulos A, Weber JT, Monnet DL Source: Clinical Microbiology and Infection 18:3, 2012; doi: 10.1111/j.1469-0691.2011.03570.x
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
(16 isolates had no test results)
Frequency table
Class: factor > ordered (numeric)
@@ -422,6 +431,7 @@ names or codes, this would have worked exactly the same way:
head(my_TB_data)# rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin
+<<<<<<< HEAD
# 1 R S S I S I# 2 R S S S R I# 3 S S I I S S
@@ -437,6 +447,22 @@ names or codes, this would have worked exactly the same way:
# 6 I
We can now add the interpretation of MDR-TB to our data set. You can
use:
+=======
+# 1 I R I R I I
+# 2 I R I I I I
+# 3 S I I R S S
+# 4 R I R I R I
+# 5 S I S S R S
+# 6 S S I I I S
+# kanamycin
+# 1 I
+# 2 R
+# 3 I
+# 4 I
+# 5 R
+# 6 R
+
We can now add the interpretation of MDR-TB to our data set. You can use:
@@ -271,12 +279,16 @@ data using a custom made website. The webdesign knowledge needed
R has a huge community.
+<<<<<<< HEAD
Many R users just ask questions on websites like StackOverflow.com, the largest
online community for programmers. At the time of writing, 439,954
R-related questions have already been asked on this platform (that
covers questions and answers for any programming language). In my own
experience, most questions are answered within a couple of
minutes.
+=======
+
Many R users just ask questions on websites like StackOverflow.com, the largest online community for programmers. At the time of writing, 439,030 R-related questions have already been asked on this platform (that covers questions and answers for any programming language). In my own experience, most questions are answered within a couple of minutes.
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
R understands any data type, including
@@ -314,6 +326,7 @@ much PR as they want (like I do here), because nobody is officially
associated with or affiliated by R. It is really free.
+<<<<<<< HEAD
R is (nowadays) the preferred analysis software in
academic papers.
At present, R is among the world most powerful statistical languages,
@@ -333,6 +346,11 @@ restyled completely by volunteers who are dedicated professionals in
the field of data science. SPSS was great when there was nothing else
that could compete. But now in 2022, I don’t see any reason why SPSS
would be of any better use than R.
+=======
+
R is (nowadays) the preferred analysis software in academic papers.
+
At present, R is among the world most powerful statistical languages, and it is generally very popular in science (Bollmann et al., 2017). For all the above reasons, the number of references to R as an analysis method in academic papers is rising continuously and has even surpassed SPSS for academic use (Muenchen, 2014).
+
I believe that the thing with SPSS is, that it has always had a great user interface which is very easy to learn and use. Back when they developed it, they had very little competition, let alone from R. R didn’t even had a professional user interface until the last decade (called RStudio, see below). How people used R between the nineties and 2010 is almost completely incomparable to how R is being used now. The language itself has been restyled completely by volunteers who are dedicated professionals in the field of data science. SPSS was great when there was nothing else that could compete. But now in 2022, I don’t see any reason why SPSS would be of any better use than R.
diff --git a/docs/articles/benchmarks.html b/docs/articles/benchmarks.html
index 7ca1bb22..b63c9b9f 100644
--- a/docs/articles/benchmarks.html
+++ b/docs/articles/benchmarks.html
@@ -44,7 +44,11 @@
AMR (for R)
+<<<<<<< HEAD
1.8.1
+=======
+ 1.8.0.9005
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
@@ -185,7 +189,7 @@
-
+
Benchmarks
@@ -238,8 +242,9 @@ microorganism code B_STPHY_AURS (B stands for
as.mo("MRSA"), # Methicillin Resistant S. aureusas.mo("VISA"), # Vancomycin Intermediate S. aureus
times =25)
-print(S.aureus, unit ="ms", signif =2)
+print(S.aureus, unit ="ms", signif =2)# Unit: milliseconds
+<<<<<<< HEAD
# expr min lq mean median uq max neval# as.mo("sau") 12.0 13 18.0 14.0 15.0 48 25# as.mo("stau") 54.0 59 80.0 91.0 96.0 99 25
@@ -263,6 +268,24 @@ determine.
To improve performance, we implemented two important algorithms to
save unnecessary calculations: repetitive results and
already precalculated results.
In the table above, all measurements are shown in milliseconds (thousands of seconds). A value of 5 milliseconds means it can determine 200 input values per second. It case of 200 milliseconds, this is only 5 input values per second. It is clear that accepted taxonomic names are extremely fast, but some variations are up to 65 times slower to determine.
+
To improve performance, we implemented two important algorithms to save unnecessary calculations: repetitive results and already precalculated results.
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
Repetitive results
@@ -287,8 +310,13 @@ possibly subspecies) which uses as.mo()<
# what do these values look like? They are of class <mo>:head(x)# Class <mo>
+<<<<<<< HEAD
# [1] B_ESCHR_COLI B_STRPT_MITS B_STRPT_ANGN B_STPHY_CONS B_ESCHR_COLI# [6] B_ESCHR_COLI
+=======
+# [1] B_PROTS_MRBL B_STPHY_CONS B_ESCHR_COLI B_PSDMN_AERG B_ENTRC_FCLS
+# [6] B_STPHY_AURS
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
# as the example_isolates data set has 2,000 rows, we should have 2 million itemslength(x)
@@ -301,14 +329,19 @@ possibly subspecies) which uses as.mo()<
# now let's see:run_it<-microbenchmark(mo_name(x),
times =10)
-print(run_it, unit ="ms", signif =3)
+print(run_it, unit ="ms", signif =3)# Unit: milliseconds# expr min lq mean median uq max neval
+<<<<<<< HEAD
# mo_name(x) 207 225 288 233 370 414 10
So getting official taxonomic names of 2,000,000 (!!) items
consisting of 90 unique values only takes 0.233 seconds. That is 117
nanoseconds on average. You only lose time on your unique input
values.
+=======
+# mo_name(x) 265 269 357 298 471 516 10
+
So getting official taxonomic names of 2,000,000 (!!) items consisting of 90 unique values only takes 0.298 seconds. That is 149 nanoseconds on average. You only lose time on your unique input values.
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
Precalculated results
@@ -323,8 +356,9 @@ will return the results immediately (see ‘C’ below):
B =mo_name("S. aureus"),
C =mo_name("Staphylococcus aureus"),
times =10)
-print(run_it, unit ="ms", signif =3)
+print(run_it, unit ="ms", signif =3)# Unit: milliseconds
+<<<<<<< HEAD
# expr min lq mean median uq max neval# A 10.3 10.90 11.20 11.10 11.20 12.40 10# B 31.3 32.70 38.20 33.90 35.20 79.80 10
@@ -333,6 +367,13 @@ will return the results immediately (see ‘C’ below):
"Staphylococcus aureus" takes 0.0028 seconds - it doesn’t
even start calculating if the result would be the same as the
expected resulting value. That goes for all helper functions:
+=======
+# expr min lq mean median uq max neval
+# A 12.30 12.30 12.60 12.50 12.60 14.2 10
+# B 61.70 61.90 62.70 62.40 62.50 66.2 10
+# C 3.04 3.05 6.92 3.12 3.21 40.9 10
+
So going from mo_name("Staphylococcus aureus") to "Staphylococcus aureus" takes 0.0031 seconds - it doesn’t even start calculating if the result would be the same as the expected resulting value. That goes for all helper functions:
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
run_it<-microbenchmark(A =mo_species("aureus"),
B =mo_genus("Staphylococcus"),
@@ -343,9 +384,10 @@ expected resulting value. That goes for all helper functions:
G =mo_phylum("Firmicutes"),
H =mo_kingdom("Bacteria"),
times =10)
-print(run_it, unit ="ms", signif =3)
+print(run_it, unit ="ms", signif =3)# Unit: milliseconds# expr min lq mean median uq max neval
+<<<<<<< HEAD
# A 2.30 2.55 2.68 2.66 2.85 2.94 10# B 2.27 2.38 2.59 2.56 2.83 2.88 10# C 2.22 2.25 2.51 2.47 2.74 2.87 10
@@ -360,6 +402,17 @@ function has zero knowledge about the actual microorganism, namely
"Firmicutes" anyway, there is no point in calculating the
result. And because this package contains all phyla of all known
bacteria, it can just return the initial value immediately.
+=======
+# A 3.02 3.09 3.22 3.10 3.46 3.55 10
+# B 3.03 3.04 3.21 3.12 3.42 3.48 10
+# C 3.03 3.05 3.08 3.06 3.12 3.16 10
+# D 2.98 3.01 3.17 3.09 3.40 3.47 10
+# E 3.01 3.06 3.19 3.12 3.43 3.43 10
+# F 2.95 2.99 3.11 3.05 3.16 3.46 10
+# G 2.94 3.06 3.19 3.13 3.41 3.54 10
+# H 2.93 3.01 3.12 3.08 3.19 3.42 10
+
Of course, when running mo_phylum("Firmicutes") the function has zero knowledge about the actual microorganism, namely S. aureus. But since the result would be "Firmicutes" anyway, there is no point in calculating the result. And because this package contains all phyla of all known bacteria, it can just return the initial value immediately.
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
Results in other languages
@@ -394,8 +447,9 @@ with the other languages):
ru =mo_name(CoNS, language ="ru"),
sv =mo_name(CoNS, language ="sv"),
times =100)
-print(run_it, unit ="ms", signif =4)
+print(run_it, unit ="ms", signif =4)# Unit: milliseconds
+<<<<<<< HEAD
# expr min lq mean median uq max neval# da 2.1730 2.476 3.956 2.609 2.873 45.180 100# de 2.2170 2.497 3.161 2.646 2.855 48.260 100
@@ -409,6 +463,20 @@ with the other languages):
# sv 2.2030 2.443 3.077 2.545 2.703 43.350 100
Currently supported languages are Danish, Dutch, English, French,
German, Italian, Portuguese, Russian, Spanish and Swedish.
All reference data (about microorganisms, antibiotics, R/SI
-interpretation, EUCAST rules, etc.) in this AMR package are
-reliable, up-to-date and freely available. We continually export our
-data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also
-supply tab separated files that are machine-readable and suitable for
-input in any software program, such as laboratory information
-systems.
-
On this page, we explain how to download them and how the structure
-of the data sets look like.
+
All reference data (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this AMR package are reliable, up-to-date and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply tab separated files that are machine-readable and suitable for input in any software program, such as laboratory information systems.
+
On this page, we explain how to download them and how the structure of the data sets look like.
-If you are reading this page from within R, please
-visit
-our website, which is automatically updated with every code change.
+If you are reading this page from within R, please visit our website, which is automatically updated with every code change.
Microorganisms (currently accepted names)
-
A data set with 70,760 rows and 16 columns, containing the following
-column names: mo, fullname, kingdom, phylum,
-class, order, family, genus,
-species, subspecies, rank, ref,
-species_id, source, prevalence and
-snomed.
-
This data set is in R available as microorganisms, after
-you load the AMR package.
-
It was last updated on 29 November 2021 11:38:23 UTC. Find more info
-about the structure of this data set here.
+
A data set with 70,760 rows and 16 columns, containing the following column names: mo, fullname, kingdom, phylum, class, order, family, genus, species, subspecies, rank, ref, species_id, source, prevalence and snomed.
+
This data set is in R available as microorganisms, after you load the AMR package.
+
It was last updated on 1 February 2022 22:08:20 UTC. Find more info about the structure of this data set here.
NOTE: The exported files for SAS, SPSS and Stata do not
-contain SNOMED codes, as their file size would exceed 100 MB; the file
-size limit of GitHub. Advice? Use R instead.
+
NOTE: The exported files for SAS, SPSS and Stata do not contain SNOMED codes, as their file size would exceed 100 MB; the file size limit of GitHub. Advice? Use R instead.
Source
-
Our full taxonomy of microorganisms is based on the authoritative and
-comprehensive:
+
Our full taxonomy of microorganisms is based on the authoritative and comprehensive:
@@ -456,64 +431,40 @@ Health Information Network Vocabulary Access and Distribution System
Microorganisms (previously accepted names)
-
A data set with 14,338 rows and 4 columns, containing the following
-column names: fullname, fullname_new, ref and
-prevalence.
-
Note: remember that the ‘ref’ columns contains the
-scientific reference to the old taxonomic entries, i.e. of column
-‘fullname’. For the scientific reference of the new names,
-i.e. of column ‘fullname_new’, see the
-microorganisms data set.
-
This data set is in R available as microorganisms.old,
-after you load the AMR package.
-
It was last updated on 6 October 2021 14:38:29 UTC. Find more info
-about the structure of this data set here.
+
A data set with 14,338 rows and 4 columns, containing the following column names: fullname, fullname_new, ref and prevalence.
+
Note: remember that the ‘ref’ columns contains the scientific reference to the old taxonomic entries, i.e. of column ‘fullname’. For the scientific reference of the new names, i.e. of column ‘fullname_new’, see the microorganisms data set.
+
This data set is in R available as microorganisms.old, after you load the AMR package.
+
It was last updated on 1 February 2022 22:08:19 UTC. Find more info about the structure of this data set here.
@@ -546,50 +497,31 @@ Standing in Nomenclature (LPSN, last updated: 5 October 2021)
Antibiotic agents
-
A data set with 464 rows and 14 columns, containing the following
-column names: ab, cid, name, group, atc,
-atc_group1, atc_group2, abbreviations,
-synonyms, oral_ddd, oral_units,
-iv_ddd, iv_units and loinc.
-
This data set is in R available as antibiotics, after
-you load the AMR package.
-
It was last updated on 14 December 2021 21:59:33 UTC. Find more info
-about the structure of this data set here.
+
A data set with 464 rows and 14 columns, containing the following column names: ab, cid, name, group, atc, atc_group1, atc_group2, abbreviations, synonyms, oral_ddd, oral_units, iv_ddd, iv_units and loinc.
+
This data set is in R available as antibiotics, after you load the AMR package.
+
It was last updated on 1 February 2022 22:08:19 UTC. Find more info about the structure of this data set here.
This data set contains all EARS-Net and ATC codes gathered from WHO
-and WHONET, and all compound IDs from PubChem. It also contains all
-brand names (synonyms) as found on PubChem and Defined Daily Doses
-(DDDs) for oral and parenteral administration.
+
This data set contains all EARS-Net and ATC codes gathered from WHO and WHONET, and all compound IDs from PubChem. It also contains all brand names (synonyms) as found on PubChem and Defined Daily Doses (DDDs) for oral and parenteral administration.
Combinations of penicillins, incl. beta-lactamase
-inhibitors
+
Combinations of penicillins, incl. beta-lactamase inhibitors
a/c, amcl, aml, …
amocla, amoclan, amoclav, …
1.5
@@ -734,49 +665,31 @@ inhibitors
Antiviral agents
-
A data set with 102 rows and 9 columns, containing the following
-column names: atc, cid, name, atc_group,
-synonyms, oral_ddd, oral_units,
-iv_ddd and iv_units.
-
This data set is in R available as antivirals, after you
-load the AMR package.
-
It was last updated on 29 August 2020 19:53:07 UTC. Find more info
-about the structure of this data set here.
+
A data set with 102 rows and 9 columns, containing the following column names: atc, cid, name, atc_group, synonyms, oral_ddd, oral_units, iv_ddd and iv_units.
+
This data set is in R available as antivirals, after you load the AMR package.
+
It was last updated on 23 July 2021 20:35:47 UTC. Find more info about the structure of this data set here.
This data set contains all ATC codes gathered from WHO and all
-compound IDs from PubChem. It also contains all brand names (synonyms)
-as found on PubChem and Defined Daily Doses (DDDs) for oral and
-parenteral administration.
+
This data set contains all ATC codes gathered from WHO and all compound IDs from PubChem. It also contains all brand names (synonyms) as found on PubChem and Defined Daily Doses (DDDs) for oral and parenteral administration.
Example content
@@ -1162,40 +1059,27 @@ v3.3 (2021).
Interpretation from MIC values / disk diameters to R/SI
-
A data set with 20,318 rows and 11 columns, containing the following
-column names: guideline, method, site, mo,
-rank_index, ab, ref_tbl, disk_dose,
-breakpoint_S, breakpoint_R and uti.
-
This data set is in R available as rsi_translation,
-after you load the AMR package.
-
It was last updated on 14 December 2021 21:59:33 UTC. Find more info
-about the structure of this data set here.
+
A data set with 20,318 rows and 11 columns, containing the following column names: guideline, method, site, mo, rank_index, ab, ref_tbl, disk_dose, breakpoint_S, breakpoint_R and uti.
+
This data set is in R available as rsi_translation, after you load the AMR package.
+
It was last updated on 1 February 2022 22:08:20 UTC. Find more info about the structure of this data set here.
This data set contains interpretation rules for MIC values and disk
-diffusion diameters. Included guidelines are CLSI (2010-2021) and EUCAST
-(2011-2021).
+
This data set contains interpretation rules for MIC values and disk diffusion diameters. Included guidelines are CLSI (2010-2021) and EUCAST (2011-2021).
Example content
@@ -1313,57 +1197,33 @@ diffusion diameters. Included guidelines are CLSI (2010-2021) and EUCAST
Dosage guidelines from EUCAST
-
A data set with 169 rows and 9 columns, containing the following
-column names: ab, name, type, dose,
-dose_times, administration, notes,
-original_txt and eucast_version.
-
This data set is in R available as dosage, after you
-load the AMR package.
-
It was last updated on 25 January 2021 20:58:20 UTC. Find more info
-about the structure of this data set here.
+
A data set with 169 rows and 9 columns, containing the following column names: ab, name, type, dose, dose_times, administration, notes, original_txt and eucast_version.
+
This data set is in R available as dosage, after you load the AMR package.
+
It was last updated on 23 July 2021 20:35:47 UTC. Find more info about the structure of this data set here.
@@ -225,6 +229,7 @@ AMR data analysis. Based on a date column, it calculates cases per
year and uses a regression model to predict antimicrobial
resistance.
It is basically as easy as:
+<<<<<<< HEAD
# resistance prediction of piperacillin/tazobactam (TZP):resistance_predict(tbl = example_isolates, col_date ="date", col_ab ="TZP", model ="binomial")
@@ -242,6 +247,22 @@ resistance.
When running any of these commands, a summary of the regression model
will be printed unless using
resistance_predict(..., info = FALSE).
+=======
+
# resistance prediction of piperacillin/tazobactam (TZP):
+resistance_predict(tbl = example_isolates, col_date ="date", col_ab ="TZP", model ="binomial")
+
+# or:
+example_isolates %>%
+resistance_predict(col_ab ="TZP",
+ model "binomial")
+
+# to bind it to object 'predict_TZP' for example:
+predict_TZP <-example_isolates %>%
+resistance_predict(col_ab ="TZP",
+model ="binomial")
+
The function will look for a date column itself if col_date is not set.
+
When running any of these commands, a summary of the regression model will be printed unless using resistance_predict(..., info = FALSE).
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
# ℹ Using column 'date' as input for `col_date`.
This text is only a printed summary - the actual result (output) of
the function is a data.frame containing for each year: the
@@ -281,9 +302,13 @@ resistance and the standard error below and above the estimation:
# 29 2030 0.48639359 0.3782932 0.5944939 NA NA 0.48639359# 30 2031 0.51109592 0.3973697 0.6248221 NA NA 0.51109592# 31 2032 0.53574417 0.4169574 0.6545309 NA NA 0.53574417
+<<<<<<< HEAD
The function plot is available in base R, and can be
extended by other packages to depend the output based on the type of
input. We extended its function to cope with resistance predictions:
+=======
+
The function plot is available in base R, and can be extended by other packages to depend the output based on the type of input. We extended its function to cope with resistance predictions:
diff --git a/docs/authors.html b/docs/authors.html
index e8774d3f..67f18a9b 100644
--- a/docs/authors.html
+++ b/docs/authors.html
@@ -269,13 +269,11 @@ Antimicrobial Resistance Data. Journal of Statistical Software (accepted for pub
diff --git a/docs/index.html b/docs/index.html
index 5f4442d8..38631e46 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -195,75 +195,22 @@
AMR (for R)
-
Update: The latest EUCAST
-guideline for intrinsic resistance (v3.3, October 2021) is now
-supported, the CLSI 2021 interpretation guideline is now supported, and
-our taxonomy tables have been updated as well (LPSN, 5 October
-2021).
+
Update: The latest EUCAST guideline for intrinsic resistance (v3.3, October 2021) is now supported, the CLSI 2021 interpretation guideline is now supported, and our taxonomy tables have been updated as well (LPSN, 5 October 2021).
What is AMR (for R)?
-
AMR is a free, open-source and independent R package (see Copyright) to simplify the analysis and prediction
-of Antimicrobial Resistance (AMR) and to work with microbial and
-antimicrobial data and properties, by using evidence-based methods.
-Our aim is to provide a standard for clean and
-reproducible AMR data analysis, that can therefore empower
-epidemiological analyses to continuously enable surveillance and
-treatment evaluation in any setting.
The AMR package is available in
-
-Danish,
-
-Dutch,
-
-English,
-
-French,
-
-German,
-
-Italian,
-
-Portuguese,
-
-Russian,
-
-Spanish and
-
-Swedish. Antimicrobial drug (group) names and colloquial microorganism
-names are provided in these languages.
AMR is a free, open-source and independent R package (see Copyright) to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial data and properties, by using evidence-based methods. Our aim is to provide a standard for clean and reproducible AMR data analysis, that can therefore empower epidemiological analyses to continuously enable surveillance and treatment evaluation in any setting.
The AMR package is available in Danish, Dutch, English, French, German, Italian, Portuguese, Russian, Spanish and Swedish. Antimicrobial drug (group) names and colloquial microorganism names are provided in these languages.
-
-Used in 175 countries Since its first public
-release in early 2018, this R package has been used in almost all
-countries in the world. Click the map to enlarge and to see the country
-names.
+Used in 175 countries Since its first public release in early 2018, this R package has been used in almost all countries in the world. Click the map to enlarge and to see the country names.
-
With AMR (for R), there’s always a knowledgeable
-microbiologist by your side!
+
With AMR (for R), there’s always a knowledgeable microbiologist by your side!
# AMR works great with dplyr, but it's not required or neccesary
@@ -277,12 +224,7 @@ microbiologist by your side!select(bacteria,
aminoglycosides(),
carbapenems())
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.
+
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.
Latest development version
-
The latest and unpublished development version can be installed from
-GitHub in two ways:
+
The latest and unpublished development version can be installed from GitHub in two ways:
Manually, using:
@@ -475,16 +393,11 @@ GitHub in two ways:
remotes::install_github("msberends/AMR")
After this, you can install and update this AMR package
-like any official release (e.g., using
-install.packages("AMR") or in RStudio via Tools
-> Check for Package Updates…).
+
After this, you can install and update this AMR package like any official release (e.g., using install.packages("AMR") or in RStudio via Tools > Check for Package Updates…).
This package contains the complete taxonomic tree of almost all
-~70,000 microorganisms from the authoritative and comprehensive
-Catalogue of Life (CoL, www.catalogueoflife.org),
-supplemented by data from the List of Prokaryotic names with Standing in
-Nomenclature (LPSN, lpsn.dsmz.de).
-This supplementation is needed until the CoL+ project is finished,
-which we await. With catalogue_of_life_version() can be
-checked which version of the CoL is included in this package.
+
This package contains the complete taxonomic tree of almost all ~70,000 microorganisms from the authoritative and comprehensive Catalogue of Life (CoL, www.catalogueoflife.org), supplemented by data from the List of Prokaryotic names with Standing in Nomenclature (LPSN, lpsn.dsmz.de). This supplementation is needed until the CoL+ project is finished, which we await. With catalogue_of_life_version() can be checked which version of the CoL is included in this package.
Read more about which data from the Catalogue of Life in our manual.
Antimicrobial reference data
-
This package contains all ~550 antibiotic, antimycotic and
-antiviral drugs and their Anatomical Therapeutic Chemical (ATC)
-codes, ATC groups and Defined Daily Dose (DDD, oral and IV) from the
-World Health Organization Collaborating Centre for Drug Statistics
-Methodology (WHOCC, https://www.whocc.no) and the Pharmaceuticals
-Community Register of the European Commission.
This package contains all ~550 antibiotic, antimycotic and antiviral drugs and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD, oral and IV) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, https://www.whocc.no) and the Pharmaceuticals Community Register of the European Commission.
We support WHONET and EARS-Net data. Exported files from WHONET can
-be imported into R and can be analysed easily using this package. For
-education purposes, we created an example data set WHONET
-with the exact same structure as a WHONET export file. Furthermore, this
-package also contains a data set
-antibiotics with all EARS-Net antibiotic abbreviations, and knows
-almost all WHONET abbreviations for microorganisms. When using WHONET
-data as input for analysis, all input parameters will be set
-automatically.
We support WHONET and EARS-Net data. Exported files from WHONET can be imported into R and can be analysed easily using this package. For education purposes, we created an example data set WHONET with the exact same structure as a WHONET export file. Furthermore, this package also contains a data set antibiotics with all EARS-Net antibiotic abbreviations, and knows almost all WHONET abbreviations for microorganisms. When using WHONET data as input for analysis, all input parameters will be set automatically.
The AMR package basically does four important
-things:
+
The AMR package basically does four important things:
-
It cleanses existing data by providing new
-classes for microoganisms, antibiotics and antimicrobial
-results (both S/I/R and MIC). By installing this package, you teach R
-everything about microbiology that is needed for analysis. These
-functions all use intelligent rules to guess results that you would
-expect:
+
It cleanses existing data by providing new classes for microoganisms, antibiotics and antimicrobial results (both S/I/R and MIC). By installing this package, you teach R everything about microbiology that is needed for analysis. These functions all use intelligent rules to guess results that you would expect:
-
Use as.mo() to get a microbial ID. The IDs are human
-readable for the trained eye - the ID of Klebsiella pneumoniae
-is “B_KLBSL_PNMN” (B stands for Bacteria) and the ID of S.
-aureus is “B_STPHY_AURS”. The function takes almost any text as
-input that looks like the name or code of a microorganism like “E.
-coli”, “esco” or “esccol” and tries to find expected results using
-intelligent rules combined with the included Catalogue of Life data set.
-It only takes milliseconds to find results, please see our benchmarks. Moreover, it can group
-Staphylococci into coagulase negative and positive (CoNS and
-CoPS, see source) and can
-categorise Streptococci into Lancefield groups (like
-beta-haemolytic Streptococcus Group B, source).
-
Use as.ab() to get an antibiotic ID. Like microbial
-IDs, these IDs are also human readable based on those used by EARS-Net.
-For example, the ID of amoxicillin is AMX and the ID of
-gentamicin is GEN. The as.ab() function also
-uses intelligent rules to find results like accepting misspelling, trade
-names and abbrevations used in many laboratory systems. For instance,
-the values “Furabid”, “Furadantin”, “nitro” all return the ID of
-Nitrofurantoine. To accomplish this, the package contains a database
-with most LIS codes, official names, trade names, ATC codes, defined
-daily doses (DDD) and drug categories of antibiotics.
-
Use as.rsi() to get antibiotic interpretations based on
-raw MIC values (in mg/L) or disk diffusion values (in mm), or transform
-existing values to valid antimicrobial results. It produces just S, I or
-R based on your input and warns about invalid values. Even values like
-“<=0.002; S” (combined MIC/RSI) will result in “S”.
-
Use as.mic() to cleanse your MIC values. It produces a
-so-called factor (called ordinal in SPSS) with valid MIC values
-as levels. A value like “<=0.002; S” (combined MIC/RSI) will result
-in “<=0.002”.
+
Use as.mo() to get a microbial ID. The IDs are human readable for the trained eye - the ID of Klebsiella pneumoniae is “B_KLBSL_PNMN” (B stands for Bacteria) and the ID of S. aureus is “B_STPHY_AURS”. The function takes almost any text as input that looks like the name or code of a microorganism like “E. coli”, “esco” or “esccol” and tries to find expected results using intelligent rules combined with the included Catalogue of Life data set. It only takes milliseconds to find results, please see our benchmarks. Moreover, it can group Staphylococci into coagulase negative and positive (CoNS and CoPS, see source) and can categorise Streptococci into Lancefield groups (like beta-haemolytic Streptococcus Group B, source).
+
Use as.ab() to get an antibiotic ID. Like microbial IDs, these IDs are also human readable based on those used by EARS-Net. For example, the ID of amoxicillin is AMX and the ID of gentamicin is GEN. The as.ab() function also uses intelligent rules to find results like accepting misspelling, trade names and abbrevations used in many laboratory systems. For instance, the values “Furabid”, “Furadantin”, “nitro” all return the ID of Nitrofurantoine. To accomplish this, the package contains a database with most LIS codes, official names, trade names, ATC codes, defined daily doses (DDD) and drug categories of antibiotics.
+
Use as.rsi() to get antibiotic interpretations based on raw MIC values (in mg/L) or disk diffusion values (in mm), or transform existing values to valid antimicrobial results. It produces just S, I or R based on your input and warns about invalid values. Even values like “<=0.002; S” (combined MIC/RSI) will result in “S”.
+
Use as.mic() to cleanse your MIC values. It produces a so-called factor (called ordinal in SPSS) with valid MIC values as levels. A value like “<=0.002; S” (combined MIC/RSI) will result in “<=0.002”.
-
It enhances existing data and adds new
-data from data sets included in this package.
+
It enhances existing data and adds new data from data sets included in this package.
You can also identify first weighted isolates of every
-patient, an adjusted version of the CLSI guideline. This takes into
-account key antibiotics of every strain and compares them.
+
You can also identify first weighted isolates of every patient, an adjusted version of the CLSI guideline. This takes into account key antibiotics of every strain and compares them.
-
Use mdro() to determine which micro-organisms are
-multi-drug resistant organisms (MDRO). It supports a variety of
-international guidelines, such as the MDR-paper by Magiorakos et
-al. (2012, PMID
-21793988), the exceptional phenotype definitions of EUCAST and the
-WHO guideline on multi-drug resistant TB. It also supports the national
-guidelines of the Netherlands and Germany.
-
The data set
-microorganisms contains the complete taxonomic tree of ~70,000
-microorganisms. Furthermore, some colloquial names and all Gram stains
-are available, which enables resistance analysis of e.g. different
-antibiotics per Gram stain. The package also contains functions to look
-up values in this data set like mo_genus(),
-mo_family(), mo_gramstain() or even
-mo_phylum(). Use mo_snomed() to look up any
-SNOMED CT code associated with a microorganism. As all these function
-use as.mo() internally, they also use the same intelligent
-rules for determination. For example, mo_genus("MRSA") and
-mo_genus("S. aureus") will both return
-"Staphylococcus". They also come with support for German,
-Danish, Dutch, Spanish, Italian, French and Portuguese. These functions
-can be used to add new variables to your data.
-
The data set antibiotics
-contains ~450 antimicrobial drugs with their EARS-Net code, ATC code,
-PubChem compound ID, LOINC code, official name, common LIS codes and
-DDDs of both oral and parenteral administration. It also contains all
-(thousands of) trade names found in PubChem. Use functions like
-ab_name(), ab_group(), ab_atc(),
-ab_loinc() and ab_tradenames() to look up
-values. The ab_* functions use as.ab()
-internally so they support the same intelligent rules to guess the most
-probable result. For example, ab_name("Fluclox"),
-ab_name("Floxapen") and ab_name("J01CF05")
-will all return "Flucloxacillin". These functions can again
-be used to add new variables to your data.
+
Use mdro() to determine which micro-organisms are multi-drug resistant organisms (MDRO). It supports a variety of international guidelines, such as the MDR-paper by Magiorakos et al. (2012, PMID 21793988), the exceptional phenotype definitions of EUCAST and the WHO guideline on multi-drug resistant TB. It also supports the national guidelines of the Netherlands and Germany.
+
The data set microorganisms contains the complete taxonomic tree of ~70,000 microorganisms. Furthermore, some colloquial names and all Gram stains are available, which enables resistance analysis of e.g. different antibiotics per Gram stain. The package also contains functions to look up values in this data set like mo_genus(), mo_family(), mo_gramstain() or even mo_phylum(). Use mo_snomed() to look up any SNOMED CT code associated with a microorganism. As all these function use as.mo() internally, they also use the same intelligent rules for determination. For example, mo_genus("MRSA") and mo_genus("S. aureus") will both return "Staphylococcus". They also come with support for German, Danish, Dutch, Spanish, Italian, French and Portuguese. These functions can be used to add new variables to your data.
+
The data set antibiotics contains ~450 antimicrobial drugs with their EARS-Net code, ATC code, PubChem compound ID, LOINC code, official name, common LIS codes and DDDs of both oral and parenteral administration. It also contains all (thousands of) trade names found in PubChem. Use functions like ab_name(), ab_group(), ab_atc(), ab_loinc() and ab_tradenames() to look up values. The ab_* functions use as.ab() internally so they support the same intelligent rules to guess the most probable result. For example, ab_name("Fluclox"), ab_name("Floxapen") and ab_name("J01CF05") will all return "Flucloxacillin". These functions can again be used to add new variables to your data.
-
It analyses the data with convenient functions
-that use well-known methods.
+
It analyses the data with convenient functions that use well-known methods.
Plot AMR results with geom_rsi(), a function made for the ggplot2 package
+
Predict antimicrobial resistance for the nextcoming years using logistic regression models with the resistance_predict() function
-
It teaches the user how to use all the above
-actions.
+
It teaches the user how to use all the above actions.
-
Aside from this website with many tutorials, the package itself
-contains extensive help pages with many examples for all functions.
+
Aside from this website with many tutorials, the package itself contains extensive help pages with many examples for all functions.
The package also contains example data sets:
-
The example_isolates
-data set. This data set contains 2,000 microbial isolates with their
-full antibiograms. It reflects reality and can be used to practice AMR
-data analysis.
-
The WHONET data
-set. This data set only contains fake data, but with the exact same
-structure as files exported by WHONET. Read more about WHONET on its tutorial page.
+
The example_isolates data set. This data set contains 2,000 microbial isolates with their full antibiograms. It reflects reality and can be used to practice AMR data analysis.
+
The WHONET data set. This data set only contains fake data, but with the exact same structure as files exported by WHONET. Read more about WHONET on its tutorial page.
@@ -687,9 +484,7 @@ structure as files exported by WHONET. Read more about WHONET
diff --git a/docs/news/index.html b/docs/news/index.html
index 1bccdd4c..7377c11a 100644
--- a/docs/news/index.html
+++ b/docs/news/index.html
@@ -17,7 +17,11 @@
AMR (for R)
+<<<<<<< HEAD
1.8.1
+=======
+ 1.8.0.9005
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
@@ -157,6 +161,7 @@
+<<<<<<< HEAD
AMR 1.8.1
All functions in this package are considered to be stable. Updates to
@@ -174,6 +179,19 @@ for I (‘susceptible dose-dependent’)
Improved algorithm of as.mo(), especially for
ignoring non-taxonomic text, such as:
+=======
+
+AMR 1.8.0.9005
+
+
Last updated: 10 March 2022
+
All functions in this package are considered to be stable. Updates to the AMR interpretation rules (such as by EUCAST and CLSI), the microbial taxonomy, and the antibiotic dosages will all be updated every 6 to 12 months.
+
+
Changed
+
Fix for using as.rsi() on values containing capped values (such as >=), sometimes leading to NA
+
Support for antibiotic interpretations of the MIPS laboratory system: "U" for S (‘susceptible urine’), "D" for I (‘susceptible dose-dependent’)
+
+
Improved algorithm of as.mo(), especially for ignoring non-taxonomic text, such as:
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
mo_name("methicillin-resistant S. aureus (MRSA)")
@@ -184,7 +202,11 @@ ignoring non-taxonomic text, such as:
Updated MIC printing in tibbles
+<<<<<<< HEAD
Other
+=======
+
Other
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
Fix for unit testing on R 3.3
Fix for size of some image elements, as requested by CRAN
+NA values of the classes <mic>, <disk> and <rsi> are now exported objects of this package, e.g. NA_mic_ is an NA of class mic (just like the base R NA_character_ is an NA of class character)
+
The proportion_df(), count_df() and rsi_df() functions now return with the additional S3 class ‘rsi_df’ so they can be extended by other packages
+
The mdro() function now returns NA for all rows that have no test results
+
The species_id column in the microorganisms data set now only contains LPSN record numbers. For this reason, this column is now numeric instead of a character, and mo_url() has been updated to reflect this change.
@@ -480,12 +516,17 @@ deprecated.
key_antimicrobials() functions has been completely
rewritten.
+<<<<<<< HEAD
Function 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.
Function 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.
Added 25 common system codes for bacteria to the
microorganisms.codes data set
Added 16 common system codes for antimicrobial agents to the
@@ -547,6 +589,12 @@ tidyverse)
dplyr v1.0.6
Updated skimr::skim() usage for MIC values to also
include 25th and 75th percentiles
+=======
+
Added 25 common system codes for bacteria to the microorganisms.codes data set
+
Added 16 common system codes for antimicrobial agents to the antibiotics data set
+
Fix for using skimr::skim() on classes mo, mic and disk when using the just released dplyr v1.0.6
+
Updated skimr::skim() usage for MIC values to also include 25th and 75th percentiles
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
Fix for plotting missing MIC/disk diffusion values
Updated join functions to always use dplyr join
functions if the dplyr package is installed - now also
@@ -625,11 +673,16 @@ function) to select/filter on e.g. linezolid and tedizolid
x<-example_isolates%>%filter_oxazolidinones()#> Filtering on oxazolidinones: value in column `LNZ` (linezolid) is either "R", "S" or "I"
+<<<<<<< HEAD
Support for custom MDRO guidelines, using the new
custom_mdro_guideline() function, please see
mdro() for additional info
Function mo_is_yeast(), which determines whether a
microorganism is a member of the taxonomic class Saccharomycetes or the
@@ -686,6 +739,7 @@ synomyms
Big update for plotting classes rsi,
<mic>, and <disk>:
Plotting of MIC and disk diffusion values now support interpretation
@@ -699,6 +753,13 @@ translated if the system language is German, Dutch or Spanish (see
Plotting is now possible with base R using plot() and
with ggplot2 using ggplot() on any vector of MIC and disk
diffusion values
+=======
+
Big update for plotting classes rsi, <mic>, and <disk>:
+
Plotting of MIC and disk diffusion values now support interpretation colouring if you supply the microorganism and antimicrobial agent
+
All colours were updated to colour-blind friendly versions for values R, S and I for all plot methods (also applies to tibble printing)
+
Interpretation of MIC and disk diffusion values to R/SI will now be translated if the system language is German, Dutch or Spanish (see translate)
+
Plotting is now possible with base R using plot() and with ggplot2 using ggplot() on any vector of MIC and disk diffusion values
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
Updated SNOMED codes to US Edition of SNOMED CT from 1 September
2020 and added the source to the help page of the
@@ -1266,6 +1327,7 @@ 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:
+<<<<<<< HEAD
Function freq() that was borrowed from the
cleaner package was removed. Use
cleaner::freq(), or run library("cleaner")
@@ -1282,6 +1344,12 @@ slower when running on hundreds of thousands of rows.
also inherit class character, to support any data
transformation. This change invalidates code that checks for class
length == 1.
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.
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
@@ -1694,6 +1762,7 @@ data integrity, this means that invalid assignments will now result in
x[1]<-"testvalue"#> Warning message:#> invalid microorganism code, NA generated
+<<<<<<< HEAD
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.
@@ -1705,6 +1774,12 @@ re-exported from the clean package (which will be installed
automatically upon updating this AMR package).
Renamed data set septic_patients to
example_isolates
+=======
+
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).
+
Renamed data set septic_patients to example_isolates
+>>>>>>> 8c9feea087f568fd4abbdb325140d1d628e6856f
New
@@ -2053,6 +2128,7 @@ be viewed here
caption, x.title and y.title to
set titles and axis descriptions
+<<<<<<< HEAD
Improved intelligence of looking up antibiotic columns in a data set
using guess_ab_col()
@@ -2071,6 +2147,14 @@ since it uses count_df() inte
Improved intelligence of looking up antibiotic columns in a data set using guess_ab_col()
+
+
Added ~5,000 more old taxonomic names to the microorganisms.old data set, which leads to better results finding when using the as.mo() function
+
This package now honours the new EUCAST insight (2019) that S and I are but classified as susceptible, where I is defined as ‘increased exposure’ and not ‘intermediate’ anymore. For functions like portion_df() and count_df() this means that their new argument combine_SI is TRUE at default. Our plotting function ggplot_rsi() also reflects this change since it uses count_df() internally.
+
The age() function gained a new argument exact to determine ages with decimals
Function scale_y_percent() now contains the
@@ -2563,6 +2663,7 @@ now supports genus abbreviations with “species” attached
as.mo("S. spp")# B_STPHYmo_fullname("S. species")# "Staphylococcus species"
+<<<<<<< HEAD
Added argument combine_IR (TRUE/FALSE) to functions
portion_df and count_df, to indicate that all
values of I and R must be merged into one, so the output only consists
@@ -2579,6 +2680,13 @@ 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
+=======
+
Added argument combine_IR (TRUE/FALSE) to functions portion_df and count_df, to indicate that all values of I and R must be merged into one, so the output only consists of S vs. IR (susceptible vs. non-susceptible)
+
Fix for portion_*(..., as_percent = TRUE) when minimal number of isolates would not be met
+
Added argument also_single_tested for portion_* and count_* functions to also include cases where not all antibiotics were tested but at least one of the tested antibiotics includes the target antimicribial interpretation, see ?portion
+
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
diff --git a/docs/reference/ab_from_text.html b/docs/reference/ab_from_text.html
index a7dc06a5..19d04b41 100644
--- a/docs/reference/ab_from_text.html
+++ b/docs/reference/ab_from_text.html
@@ -275,13 +275,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/ab_property.html b/docs/reference/ab_property.html
index c74aa078..e43a281c 100644
--- a/docs/reference/ab_property.html
+++ b/docs/reference/ab_property.html
@@ -344,13 +344,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/age.html b/docs/reference/age.html
index f1a27b59..3bc80b34 100644
--- a/docs/reference/age.html
+++ b/docs/reference/age.html
@@ -226,13 +226,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/age_groups.html b/docs/reference/age_groups.html
index d4578dbb..c3129f13 100644
--- a/docs/reference/age_groups.html
+++ b/docs/reference/age_groups.html
@@ -250,13 +250,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/antibiotic_class_selectors.html b/docs/reference/antibiotic_class_selectors.html
index e35c6d4d..1167f37c 100644
--- a/docs/reference/antibiotic_class_selectors.html
+++ b/docs/reference/antibiotic_class_selectors.html
@@ -430,13 +430,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/as.mic.html b/docs/reference/as.mic.html
index 58914b73..0daf4317 100644
--- a/docs/reference/as.mic.html
+++ b/docs/reference/as.mic.html
@@ -273,13 +273,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/as.mo.html b/docs/reference/as.mo.html
index 0b3375d3..80bc9a5f 100644
--- a/docs/reference/as.mo.html
+++ b/docs/reference/as.mo.html
@@ -377,13 +377,11 @@ This package contains the complete taxonomic tree of almost all microorganisms (
diff --git a/docs/reference/as.rsi.html b/docs/reference/as.rsi.html
index 7fa7fad6..54631817 100644
--- a/docs/reference/as.rsi.html
+++ b/docs/reference/as.rsi.html
@@ -334,7 +334,7 @@ The lifecycle of this function is stable# \donttest{
if(require("skimr")){# class <rsi> supported in skim() too:
- skim(example_isolates)
+ skim(example_isolates)}# }# For INTERPRETING disk diffusion and MIC values -----------------------
@@ -423,13 +423,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/atc_online.html b/docs/reference/atc_online.html
index 599ecd4e..05b4b79e 100644
--- a/docs/reference/atc_online.html
+++ b/docs/reference/atc_online.html
@@ -257,13 +257,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/availability.html b/docs/reference/availability.html
index 0aae951d..c726909d 100644
--- a/docs/reference/availability.html
+++ b/docs/reference/availability.html
@@ -216,13 +216,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/bug_drug_combinations.html b/docs/reference/bug_drug_combinations.html
index f363023c..a0eb2142 100644
--- a/docs/reference/bug_drug_combinations.html
+++ b/docs/reference/bug_drug_combinations.html
@@ -265,13 +265,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/eucast_rules.html b/docs/reference/eucast_rules.html
index a8d1adcc..2760c375 100644
--- a/docs/reference/eucast_rules.html
+++ b/docs/reference/eucast_rules.html
@@ -334,13 +334,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/first_isolate.html b/docs/reference/first_isolate.html
index 64ff52ac..9f112984 100644
--- a/docs/reference/first_isolate.html
+++ b/docs/reference/first_isolate.html
@@ -371,13 +371,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/ggplot_pca.html b/docs/reference/ggplot_pca.html
index 30606c55..aac9ad2d 100644
--- a/docs/reference/ggplot_pca.html
+++ b/docs/reference/ggplot_pca.html
@@ -304,13 +304,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/ggplot_rsi.html b/docs/reference/ggplot_rsi.html
index 0dc16eef..941f6578 100644
--- a/docs/reference/ggplot_rsi.html
+++ b/docs/reference/ggplot_rsi.html
@@ -395,13 +395,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/guess_ab_col.html b/docs/reference/guess_ab_col.html
index 0eb75062..1e61bfba 100644
--- a/docs/reference/guess_ab_col.html
+++ b/docs/reference/guess_ab_col.html
@@ -243,13 +243,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
These functions are meant to get taxonomically valid properties of
-microorganisms from any input. Use mo_source() to teach
-this package how to translate your own codes to valid microorganism
-codes.
+
These functions are meant to get taxonomically valid properties of microorganisms from any input. Use mo_source() to teach this package how to translate your own codes to valid microorganism codes.
User-Defined Reference Data Set for Microorganisms
Preparing data: antibiotics
-
Use these functions to get valid properties of antibiotics from any
-input or to clean your input. You can even retrieve drug names and doses
-from clinical text records, using ab_from_text().
+
Use these functions to get valid properties of antibiotics from any input or to clean your input. You can even retrieve drug names and doses from clinical text records, using ab_from_text().
With as.mic() and as.disk() you can
-transform your raw input to valid MIC or disk diffusion values. Use
-as.rsi() for cleaning raw data to let it only contain “R”,
-“I” and “S”, or to interpret MIC or disk diffusion values as R/SI based
-on the lastest EUCAST and CLSI guidelines. Afterwards, you can extend
-antibiotic interpretations by applying EUCAST
-rules with eucast_rules().
+
With as.mic() and as.disk() you can transform your raw input to valid MIC or disk diffusion values. Use as.rsi() for cleaning raw data to let it only contain “R”, “I” and “S”, or to interpret MIC or disk diffusion values as R/SI based on the lastest EUCAST and CLSI guidelines. Afterwards, you can extend antibiotic interpretations by applying EUCAST rules with eucast_rules().
Use these function for the analysis part. You can use
-susceptibility() or resistance() on any
-antibiotic column. Be sure to first select the isolates that are
-appropiate for analysis, by using first_isolate() or
-is_new_episode(). You can also filter your data on certain
-resistance in certain antibiotic classes (carbapenems(),
-aminoglycosides()), or determine multi-drug resistant
-microorganisms (MDRO, mdro()).
+
Use these function for the analysis part. You can use susceptibility() or resistance() on any antibiotic column. Be sure to first select the isolates that are appropiate for analysis, by using first_isolate() or is_new_episode(). You can also filter your data on certain resistance in certain antibiotic classes (carbapenems(), aminoglycosides()), or determine multi-drug resistant microorganisms (MDRO, mdro()).
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.
+
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.
@@ -353,9 +333,7 @@ information about how to work with functions in this package.
Data Set with 500 Isolates - WHONET Example
Other: miscellaneous functions
-
These functions are mostly for internal use, but some of them may
-also be suitable for your analysis. Especially the ‘like’ function can
-be useful: if (x %like% y) {...}.
+
These functions are mostly for internal use, but some of them may also be suitable for your analysis. Especially the ‘like’ function can be useful: if (x %like% y) {...}.
diff --git a/docs/reference/italicise_taxonomy.html b/docs/reference/italicise_taxonomy.html
index 2d3f8f86..2c5dcf52 100644
--- a/docs/reference/italicise_taxonomy.html
+++ b/docs/reference/italicise_taxonomy.html
@@ -221,13 +221,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/join.html b/docs/reference/join.html
index a08d9d1d..b5430cb3 100644
--- a/docs/reference/join.html
+++ b/docs/reference/join.html
@@ -242,13 +242,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/key_antimicrobials.html b/docs/reference/key_antimicrobials.html
index 640b31e9..e4626ba1 100644
--- a/docs/reference/key_antimicrobials.html
+++ b/docs/reference/key_antimicrobials.html
@@ -308,13 +308,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/kurtosis.html b/docs/reference/kurtosis.html
index 02427b3f..3c02562c 100644
--- a/docs/reference/kurtosis.html
+++ b/docs/reference/kurtosis.html
@@ -210,13 +210,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/lifecycle.html b/docs/reference/lifecycle.html
index f7766476..5eb1aaf3 100644
--- a/docs/reference/lifecycle.html
+++ b/docs/reference/lifecycle.html
@@ -211,13 +211,11 @@ The lifecycle of this function is questioning. This function mi
diff --git a/docs/reference/like.html b/docs/reference/like.html
index f75dc7e2..fc9be9bc 100644
--- a/docs/reference/like.html
+++ b/docs/reference/like.html
@@ -260,13 +260,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/mo_property.html b/docs/reference/mo_property.html
index 8b33acb3..d6920e7a 100644
--- a/docs/reference/mo_property.html
+++ b/docs/reference/mo_property.html
@@ -433,13 +433,11 @@ This package contains the complete taxonomic tree of almost all microorganisms (
diff --git a/docs/reference/mo_source.html b/docs/reference/mo_source.html
index 12ce5775..f3e10490 100644
--- a/docs/reference/mo_source.html
+++ b/docs/reference/mo_source.html
@@ -267,13 +267,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/pca.html b/docs/reference/pca.html
index dfc3f036..3d6f420a 100644
--- a/docs/reference/pca.html
+++ b/docs/reference/pca.html
@@ -266,13 +266,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/plot.html b/docs/reference/plot.html
index fc39d863..7d67ef6b 100644
--- a/docs/reference/plot.html
+++ b/docs/reference/plot.html
@@ -332,13 +332,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/proportion.html b/docs/reference/proportion.html
index 15c1124d..b0347e8c 100644
--- a/docs/reference/proportion.html
+++ b/docs/reference/proportion.html
@@ -381,13 +381,11 @@ A microorganism is categorised as Susceptible, Increased exposure when
diff --git a/docs/reference/random.html b/docs/reference/random.html
index d8c7470c..be5e5dc9 100644
--- a/docs/reference/random.html
+++ b/docs/reference/random.html
@@ -232,13 +232,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/skewness.html b/docs/reference/skewness.html
index ebe1777e..842577d3 100644
--- a/docs/reference/skewness.html
+++ b/docs/reference/skewness.html
@@ -210,13 +210,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.
diff --git a/docs/reference/translate.html b/docs/reference/translate.html
index bfae1c7b..83b711ea 100644
--- a/docs/reference/translate.html
+++ b/docs/reference/translate.html
@@ -237,13 +237,11 @@ The lifecycle of this function is stable
-
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein,
-Erwin E. A. Hassing.
+
Developed by Matthijs S. Berends, Christian F. Luz, Dennis Souverein, Erwin E. A. Hassing.