vignettes/AMR.Rmd
AMR.Rmd
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 21 December 2020.
+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 24 December 2020.
Now, let’s start the cleaning and the analysis!
@@ -466,16 +449,16 @@ Longest: 1We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient R5, sorted on date:
+We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient M9, sorted on date:
isolate | @@ -548,8 +531,8 @@ Longest: 1|||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | -2010-02-05 | -R5 | +2010-01-25 | +M9 | B_ESCHR_COLI | S | S | @@ -559,19 +542,19 @@ Longest: 1||||||
2 | -2010-04-22 | -R5 | +2010-02-01 | +M9 | B_ESCHR_COLI | S | S | -R | +S | S | FALSE | ||
3 | -2010-05-16 | -R5 | +2010-02-22 | +M9 | B_ESCHR_COLI | S | S | @@ -581,30 +564,30 @@ Longest: 1||||||
4 | -2010-05-29 | -R5 | +2010-08-12 | +M9 | B_ESCHR_COLI | +I | S | S | -R | S | FALSE | ||
5 | -2010-06-16 | -R5 | +2010-08-17 | +M9 | B_ESCHR_COLI | R | -S | -S | +R | +R | S | FALSE | |
6 | -2010-10-06 | -R5 | +2010-09-18 | +M9 | B_ESCHR_COLI | S | S | @@ -614,60 +597,56 @@ Longest: 1||||||
7 | -2010-12-22 | -R5 | +2011-07-05 | +M9 | B_ESCHR_COLI | R | S | +R | +S | +TRUE | +|||
8 | +2011-07-19 | +M9 | +B_ESCHR_COLI | +R | +R | S | S | FALSE | |||||
8 | -2011-04-14 | -R5 | -B_ESCHR_COLI | -S | -S | -S | -S | -TRUE | -|||||
9 | -2011-11-27 | -R5 | +2011-07-20 | +M9 | B_ESCHR_COLI | S | S | S | -R | +S | FALSE | ||
10 | -2012-11-12 | -R5 | +2011-09-04 | +M9 | B_ESCHR_COLI | +R | +I | S | S | -S | -S | -TRUE | +FALSE |
Only 3 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The key_antibiotics()
function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.
Only 2 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The key_antibiotics()
function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.
If a column exists with a name like ‘key(…)ab’ the first_isolate()
function will automatically use it and determine the first weighted isolates. Mind the NOTEs in below output:
data <- data %>%
mutate(keyab = key_antibiotics(.)) %>%
mutate(first_weighted = first_isolate(.))
-# NOTE: Using column 'bacteria' as input for `col_mo`.
-# NOTE: Using column 'bacteria' as input for `col_mo`.
-# NOTE: Using column 'date' as input for `col_date`.
-# NOTE: Using column 'patient_id' as input for `col_patient_id`.
# NOTE: Using column 'keyab' as input for `col_keyantibiotics`. Use
# col_keyantibiotics = FALSE to prevent this.
1 | -2010-02-05 | -R5 | +2010-01-25 | +M9 | B_ESCHR_COLI | S | S | @@ -698,20 +677,8 @@ Longest: 1|||||||
2 | -2010-04-22 | -R5 | -B_ESCHR_COLI | -S | -S | -R | -S | -FALSE | -FALSE | -|||||
3 | -2010-05-16 | -R5 | +2010-02-01 | +M9 | B_ESCHR_COLI | S | S | @@ -720,34 +687,46 @@ Longest: 1FALSE | TRUE | |||||
3 | +2010-02-22 | +M9 | +B_ESCHR_COLI | +S | +S | +S | +S | +FALSE | +FALSE | +|||||
4 | -2010-05-29 | -R5 | +2010-08-12 | +M9 | B_ESCHR_COLI | +I | S | S | -R | S | FALSE | -TRUE | +FALSE | |
5 | -2010-06-16 | -R5 | +2010-08-17 | +M9 | B_ESCHR_COLI | R | -S | -S | +R | +R | S | FALSE | TRUE | |
6 | -2010-10-06 | -R5 | +2010-09-18 | +M9 | B_ESCHR_COLI | S | S | @@ -758,60 +737,60 @@ Longest: 1|||||||
7 | -2010-12-22 | -R5 | +2011-07-05 | +M9 | B_ESCHR_COLI | R | S | +R | +S | +TRUE | +TRUE | +|||
8 | +2011-07-19 | +M9 | +B_ESCHR_COLI | +R | +R | S | S | FALSE | TRUE | |||||
8 | -2011-04-14 | -R5 | -B_ESCHR_COLI | -S | -S | -S | -S | -TRUE | -TRUE | -|||||
9 | -2011-11-27 | -R5 | +2011-07-20 | +M9 | B_ESCHR_COLI | S | S | S | -R | +S | FALSE | TRUE | ||
10 | -2012-11-12 | -R5 | +2011-09-04 | +M9 | B_ESCHR_COLI | +R | +I | S | S | -S | -S | -TRUE | +FALSE | TRUE |
Instead of 3, now 9 isolates are flagged. In total, 78.4% of all isolates are marked ‘first weighted’ - 50.1% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.
+Instead of 2, now 8 isolates are flagged. In total, 78.4% of all isolates are marked ‘first weighted’ - 50.0% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.
As with filter_first_isolate()
, there’s a shortcut for this new algorithm too:
data_1st <- data %>%
filter_first_weighted_isolate()
So we end up with 15,689 isolates for analysis.
+So we end up with 15,683 isolates for analysis.
We can remove unneeded columns:
data_1st <- data_1st %>%
@@ -821,6 +800,7 @@ Longest: 1
head(data_1st)
date | patient_id | hospital | @@ -852,27 +833,77 @@ Longest: 1|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2013-07-24 | -S10 | +1 | +2012-10-07 | +D7 | +Hospital B | +B_ESCHR_COLI | +R | +S | +R | +S | +M | +Gram-negative | +Escherichia | +coli | +TRUE | +||
2 | +2016-11-19 | +V9 | +Hospital A | +B_KLBSL_PNMN | +R | +S | +S | +S | +F | +Gram-negative | +Klebsiella | +pneumoniae | +TRUE | +||||
3 | +2015-03-30 | +D9 | Hospital D | B_STPHY_AURS | R | S | S | S | -F | +M | Gram-positive | Staphylococcus | aureus | TRUE | |||
2011-06-06 | -X7 | -Hospital B | +5 | +2014-03-04 | +M4 | +Hospital C | +B_STPHY_AURS | +S | +S | +S | +S | +M | +Gram-positive | +Staphylococcus | +aureus | +TRUE | +|
7 | +2011-02-08 | +S3 | +Hospital D | B_STRPT_PNMN | -R | -R | +S | +S | S | R | F | @@ -881,62 +912,18 @@ Longest: 1pneumoniae | TRUE | ||||
2010-08-03 | -E6 | -Hospital B | -B_ESCHR_COLI | -R | -I | -S | -S | -M | -Gram-negative | -Escherichia | -coli | -TRUE | -|||||
2014-03-25 | -S8 | -Hospital B | -B_ESCHR_COLI | -R | -R | -S | -S | -F | -Gram-negative | -Escherichia | -coli | -TRUE | -|||||
2010-09-19 | -J1 | +8 | +2015-12-31 | +I5 | Hospital D | -B_KLBSL_PNMN | +B_ESCHR_COLI | +R | R | R | -S | S | M | Gram-negative | -Klebsiella | -pneumoniae | -TRUE | -
2017-05-11 | -T3 | -Hospital A | -B_ESCHR_COLI | -S | -S | -S | -S | -F | -Gram-negative | Escherichia | coli | TRUE | @@ -962,8 +949,8 @@ Longest: 1|||||
1 | Escherichia coli | -7,859 | -50.09% | -7,859 | -50.09% | +7,815 | +49.83% | +7,815 | +49.83% | ||||||||
2 | Staphylococcus aureus | -3,819 | -24.34% | -11,678 | -74.43% | +4,001 | +25.51% | +11,816 | +75.34% | ||||||||
3 | Streptococcus pneumoniae | -2,391 | -15.24% | -14,069 | -89.67% | +2,330 | +14.86% | +14,146 | +90.20% | ||||||||
4 | Klebsiella pneumoniae | -1,620 | -10.33% | -15,689 | +1,537 | +9.80% | +15,683 | 100.00% |
mo | @@ -1034,60 +1020,59 @@ Longest: 24|||||||||
---|---|---|---|---|---|---|---|---|---|
E. coli | AMX | -3784 | -256 | -3819 | -7859 | +3744 | +257 | +3814 | +7815 |
E. coli | AMC | -6190 | -308 | -1361 | -7859 | +6185 | +294 | +1336 | +7815 |
E. coli | CIP | -5948 | +5934 | 0 | -1911 | -7859 | +1881 | +7815 | |
E. coli | GEN | -7110 | +7005 | 0 | -749 | -7859 | +810 | +7815 | |
K. pneumoniae | AMX | 0 | 0 | -1620 | -1620 | +1537 | +1537 | ||
K. pneumoniae | AMC | -1270 | -54 | -296 | -1620 | +1225 | +45 | +267 | +1537 |
Using Tidyverse selections, you can also select columns based on the antibiotic class they are in:
-+-data_1st %>% select(bacteria, fluoroquinolones()) %>% bug_drug_combinations()
+# Selecting fluoroquinolones: 'CIP' (ciprofloxacin) -# NOTE: Using column 'bacteria' as input for `col_mo`.
# Selecting fluoroquinolones: 'CIP' (ciprofloxacin)
mo | @@ -1101,34 +1086,34 @@ Longest: 24||||||||
---|---|---|---|---|---|---|---|---|
E. coli | CIP | -5948 | +5934 | 0 | -1911 | -7859 | +1881 | +7815 |
K. pneumoniae | CIP | -1232 | +1189 | 0 | -388 | -1620 | +348 | +1537 |
S. aureus | CIP | -2943 | +3064 | 0 | -876 | -3819 | +937 | +4001 |
S. pneumoniae | CIP | -1797 | +1780 | 0 | -594 | -2391 | +550 | +2330 |
The functions resistance()
and susceptibility()
can be used to calculate antimicrobial resistance or susceptibility. For more specific analyses, the functions proportion_S()
, proportion_SI()
, proportion_I()
, proportion_IR()
and proportion_R()
can be used to determine the proportion of a specific antimicrobial outcome.
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:
++# [1] 0.5342728data_1st %>% resistance(AMX) -# [1] 0.5359806
Or can be used in conjuction with group_by()
and summarise()
, both from the dplyr
package:
+@@ -1156,24 +1141,24 @@ Longest: 24data_1st %>% group_by(hospital) %>% summarise(amoxicillin = resistance(AMX))
Hospital A -0.5285074 +0.5253802 Hospital B -0.5438369 +0.5367779 Hospital C -0.5389447 +0.5470814 Hospital D -0.5314924 +0.5334627
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) %>% summarise(amoxicillin = resistance(AMX), @@ -1188,28 +1173,28 @@ Longest: 24
Hospital A -0.5285074 -4683 +0.5253802 +4669 Hospital B -0.5438369 -5395 +0.5367779 +5574 Hospital C -0.5389447 -2388 +0.5470814 +2347 Hospital D -0.5314924 -3223 +0.5334627 +3093 These functions can also be used to get the proportion of multiple antibiotics, to calculate empiric susceptibility of combination therapies very easily:
-@@ -210,7 +193,7 @@+data_1st %>% group_by(genus) %>% summarise(amoxiclav = susceptibility(AMC), @@ -1226,32 +1211,32 @@ Longest: 24
Escherichia -0.8268228 -0.9046953 -0.9846036 +0.8290467 +0.8963532 +0.9843890 Klebsiella -0.8172840 -0.8950617 -0.9827160 +0.8262850 +0.9095641 +0.9837345 Staphylococcus -0.8292747 -0.9193506 -0.9832417 +0.8307923 +0.9122719 +0.9872532 Streptococcus -0.5411962 +0.5351931 0.0000000 -0.5411962 +0.5351931 To make a transition to the next part, let’s see how this difference could be plotted:
-@@ -353,7 +336,7 @@+data_1st %>% group_by(genus) %>% summarise("1. Amoxi/clav" = susceptibility(AMC), @@ -1270,7 +1255,7 @@ Longest: 24
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:+ggplot(data = a_data_set, mapping = aes(x = year, y = value)) + @@ -1284,13 +1269,13 @@ Longest: 24 ggplot(a_data_set) + geom_bar(aes(year))
The
-AMR
package contains functions to extend thisggplot2
package, for examplegeom_rsi()
. It automatically transforms data withcount_df()
orproportion_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:+# group the data on `genus` ggplot(data_1st %>% group_by(genus)) + # create bars with genus on x axis @@ -1313,7 +1298,7 @@ Longest: 24 theme(axis.text.y = element_text(face = "italic"))
To simplify this, we also created the
-ggplot_rsi()
function, which combines almost all above functions:+@@ -268,7 +251,7 @@data_1st %>% group_by(genus) %>% ggplot_rsi(x = "genus", @@ -1328,7 +1313,7 @@ Longest: 24 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 analysis.We will compare the resistance to fosfomycin (column
-FOS
) in hospital A and D. The input for thefisher.test()
can be retrieved with a transformation like this:+# use package 'tidyr' to pivot data: library(tidyr) @@ -1347,7 +1332,7 @@ Longest: 24 # [1,] 25 77 # [2,] 24 33
We can apply the test now with:
-@@ -419,7 +402,7 @@+# do Fisher's Exact Test fisher.test(check_FOS) # @@ -1381,7 +1366,7 @@ Longest: 24
-diff --git a/docs/articles/AMR_files/figure-html/plot 1-1.png b/docs/articles/AMR_files/figure-html/plot 1-1.png index 8612585d2..e63aea5e6 100644 Binary files a/docs/articles/AMR_files/figure-html/plot 1-1.png and b/docs/articles/AMR_files/figure-html/plot 1-1.png differ diff --git a/docs/articles/AMR_files/figure-html/plot 3-1.png b/docs/articles/AMR_files/figure-html/plot 3-1.png index 6327eadd5..39bcc1471 100644 Binary files a/docs/articles/AMR_files/figure-html/plot 3-1.png and b/docs/articles/AMR_files/figure-html/plot 3-1.png differ diff --git a/docs/articles/AMR_files/figure-html/plot 4-1.png b/docs/articles/AMR_files/figure-html/plot 4-1.png index eb02d16b2..b58a3e740 100644 Binary files a/docs/articles/AMR_files/figure-html/plot 4-1.png and b/docs/articles/AMR_files/figure-html/plot 4-1.png differ diff --git a/docs/articles/AMR_files/figure-html/plot 5-1.png b/docs/articles/AMR_files/figure-html/plot 5-1.png index 81e1f8648..5817821ca 100644 Binary files a/docs/articles/AMR_files/figure-html/plot 5-1.png and b/docs/articles/AMR_files/figure-html/plot 5-1.png differ diff --git a/docs/articles/EUCAST.html b/docs/articles/EUCAST.html index 35e50ba83..d1e919d31 100644 --- a/docs/articles/EUCAST.html +++ b/docs/articles/EUCAST.html @@ -5,32 +5,15 @@ - -Made with pkgdown 1.6.1, using preferably template.
+Site built with pkgdown 1.6.1.
How to apply EUCAST rules • AMR (for R) +How to apply EUCAST rules • AMR (for R) - - - - - - + + @@ -56,7 +39,7 @@-diff --git a/docs/articles/MDR.html b/docs/articles/MDR.html index 3d8a28871..c638f0e5f 100644 --- a/docs/articles/MDR.html +++ b/docs/articles/MDR.html @@ -5,32 +5,15 @@ - -Made with pkgdown 1.6.1, using preferably template.
+Site built with pkgdown 1.6.1.
How to determine multi-drug resistance (MDR) • AMR (for R) +How to determine multi-drug resistance (MDR) • AMR (for R) - - - - - - + + @@ -56,7 +39,7 @@example_isolates %>% mdro() %>% freq() # show frequency table of the result -# Warning in warning_("NA introduced for isolates where the available percentage of antimicrobial classes was below ", : NA introduced for isolates where the available percentage of antimicrobial +# Warning: NA introduced for isolates where the available percentage of antimicrobial # classes was below 50% (set with `pct_required_classes`)
Frequency table
Class: factor > ordered (numeric)
@@ -306,48 +289,41 @@ Unique: 2For another example, I will create a data set to determine multi-drug resistant TB:
+-# a helper function to get a random vector with values S, I and R -# with the probabilities 50% - 10% - 40% -sample_rsi <- function() { - sample(c("S", "I", "R"), - size = 5000, - prob = c(0.5, 0.1, 0.4), - replace = TRUE) -} - -my_TB_data <- data.frame(rifampicin = sample_rsi(), - isoniazid = sample_rsi(), - gatifloxacin = sample_rsi(), - ethambutol = sample_rsi(), - pyrazinamide = sample_rsi(), - moxifloxacin = sample_rsi(), - kanamycin = sample_rsi())
# random_rsi() is a helper function to generate +# a random vector with values S, I and R +my_TB_data <- data.frame(rifampicin = random_rsi(5000), + isoniazid = random_rsi(5000), + gatifloxacin = random_rsi(5000), + ethambutol = random_rsi(5000), + pyrazinamide = random_rsi(5000), + moxifloxacin = random_rsi(5000), + kanamycin = random_rsi(5000))
Because all column names are automatically verified for valid drug names or codes, this would have worked exactly the same:
+-my_TB_data <- data.frame(RIF = sample_rsi(), - INH = sample_rsi(), - GAT = sample_rsi(), - ETH = sample_rsi(), - PZA = sample_rsi(), - MFX = sample_rsi(), - KAN = sample_rsi())
my_TB_data <- data.frame(RIF = random_rsi(5000), + INH = random_rsi(5000), + GAT = random_rsi(5000), + ETH = random_rsi(5000), + PZA = random_rsi(5000), + MFX = random_rsi(5000), + KAN = random_rsi(5000))
The data set now looks like this:
+# 3 I +# 4 I +# 5 I +# 6 Rhead(my_TB_data) # rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin -# 1 S R S R R S -# 2 S R S S S S -# 3 S S S S R S -# 4 S R S R S S -# 5 R S R S R S -# 6 S R R R S S +# 1 S S R I R S +# 2 I S R I I R +# 3 R R R S I R +# 4 I I R R S S +# 5 I R I S S R +# 6 I R I I S I # kanamycin -# 1 S +# 1 R # 2 S -# 3 S -# 4 S -# 5 R -# 6 S
We can now add the interpretation of MDR-TB to our data set. You can use:
@@ -378,40 +354,40 @@ Unique: 5mdro(my_TB_data, guideline = "TB")
1 Mono-resistant -3314 -66.28% -3314 -66.28% +3214 +64.28% +3214 +64.28% 2 Negative -637 -12.74% -3951 -79.02% +997 +19.94% +4211 +84.22% 3 Multi-drug-resistant -565 -11.30% -4516 -90.32% +442 +8.84% +4653 +93.06% 4 Poly-resistant -298 -5.96% -4814 -96.28% +239 +4.78% +4892 +97.84% @@ -433,7 +409,7 @@ Unique: 5 5 Extensively drug-resistant -186 -3.72% +108 +2.16% 5000 100.00% -diff --git a/docs/articles/PCA.html b/docs/articles/PCA.html index e45199c90..58207a79a 100644 --- a/docs/articles/PCA.html +++ b/docs/articles/PCA.html @@ -5,32 +5,15 @@ - -Made with pkgdown 1.6.1, using preferably template.
+Site built with pkgdown 1.6.1.
How to conduct principal component analysis (PCA) for AMR • AMR (for R) +How to conduct principal component analysis (PCA) for AMR • AMR (for R) - - - - - - + + @@ -56,7 +39,7 @@-diff --git a/docs/articles/SPSS.html b/docs/articles/SPSS.html index cc56111d7..110bc6fae 100644 --- a/docs/articles/SPSS.html +++ b/docs/articles/SPSS.html @@ -5,32 +5,15 @@ - -Made with pkgdown 1.6.1, using preferably template.
+Site built with pkgdown 1.6.1.
How to import data from SPSS / SAS / Stata • AMR (for R) +How to import data from SPSS / SAS / Stata • AMR (for R) - - - - - - + + @@ -56,7 +39,7 @@How to import data from SPSS / SAS / Stata
Matthijs S. Berends
-21 December 2020
+24 December 2020
Source:vignettes/SPSS.Rmd
@@ -431,7 +414,7 @@SPSS.Rmd
-diff --git a/docs/articles/WHONET.html b/docs/articles/WHONET.html index 73d25f65d..1e024b431 100644 --- a/docs/articles/WHONET.html +++ b/docs/articles/WHONET.html @@ -5,32 +5,15 @@ - -Made with pkgdown 1.6.1, using preferably template.
+Site built with pkgdown 1.6.1.
How to work with WHONET data • AMR (for R) +How to work with WHONET data • AMR (for R) - - - - - - + + @@ -56,7 +39,7 @@
Made with pkgdown 1.6.1, using preferably template.
+Site built with pkgdown 1.6.1.
So getting official taxonomic names of 2,000,000 (!!) items consisting of 90 unique values only takes 0.195 seconds. You only lose time on your unique input values.
+# mo_name(x) 134 167 201 179 207 310 10 +So getting official taxonomic names of 2,000,000 (!!) items consisting of 90 unique values only takes 0.179 seconds. You only lose time on your unique input values.
So going from mo_name("Staphylococcus aureus")
to "Staphylococcus aureus"
takes 0.0021 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:
So going from mo_name("Staphylococcus aureus")
to "Staphylococcus aureus"
takes 0.0022 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:
run_it <- microbenchmark(A = mo_species("aureus"),
B = mo_genus("Staphylococcus"),
@@ -333,14 +316,14 @@
print(run_it, unit = "ms", signif = 3)
# Unit: milliseconds
# expr min lq mean median uq max neval
-# A 1.60 1.63 1.74 1.70 1.83 2.02 10
-# B 1.37 1.40 1.62 1.54 1.74 2.07 10
-# C 1.39 1.45 1.63 1.65 1.77 1.86 10
-# D 1.37 1.40 1.58 1.51 1.62 2.27 10
-# E 1.44 1.64 1.70 1.66 1.81 2.13 10
-# F 1.38 1.42 1.57 1.58 1.67 1.81 10
-# G 1.38 1.62 1.64 1.63 1.70 1.82 10
-# H 1.44 1.65 1.84 1.82 1.99 2.60 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 ‘knows’ all phyla of all known bacteria (according to the Catalogue of Life), it can just return the initial value immediately.
Currently supported are German, Dutch, Spanish, Italian, French and Portuguese.
@@ -392,7 +375,7 @@Made with pkgdown 1.6.1, using preferably template.
+Site built with pkgdown 1.6.1.
Made with pkgdown 1.6.1, using preferably template.
+Site built with pkgdown 1.6.1.
diff --git a/docs/articles/index.html b/docs/articles/index.html index 1ca61f0bc..b5e7b58cc 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -6,22 +6,6 @@ - - - -example_isolates %>%
filter(mo_gramstain(mo, language = NULL) == "Gram-positive") %>%
resistance_predict(col_ab = "VAN", year_min = 2010, info = FALSE, model = "binomial") %>%
- ggplot_rsi_predict()
-# NOTE: Using column 'date' as input for `col_date`.
+ ggplot_rsi_predict()
Vancomycin resistance could be 100% in ten years, but might also stay around 0%.
You can define the model with the model
parameter. The model chosen above is a generalised linear regression model using a binomial distribution, assuming that a period of zero resistance was followed by a period of increasing resistance leading slowly to more and more resistance.
example_isolates %>%
filter(mo_gramstain(mo, language = NULL) == "Gram-positive") %>%
resistance_predict(col_ab = "VAN", year_min = 2010, info = FALSE, model = "linear") %>%
- ggplot_rsi_predict()
-# NOTE: Using column 'date' as input for `col_date`.
+ ggplot_rsi_predict()
This seems more likely, doesn’t it?
The model itself is also available from the object, as an attribute
:
Made with pkgdown 1.6.1, using preferably template.
+Site built with pkgdown 1.6.1.
Made with pkgdown 1.6.1, using preferably template.
+Site built with pkgdown 1.6.1.
Made with pkgdown 1.6.1, using preferably template.
+Site built with pkgdown 1.6.1.