diff --git a/R/ab.R b/R/ab.R index 12caf08f..f20b5a38 100755 --- a/R/ab.R +++ b/R/ab.R @@ -28,9 +28,9 @@ #' @inheritSection WHOCC WHOCC #' @export #' @importFrom dplyr %>% filter slice pull -#' @details All entries in the \code{\{link{antibiotics}} data set have three different identifiers: a human readable EARS-Net code (column \code{ab}, used by ECDC and WHONET), an ATC code (column \code{atc}, used by WHO), and a CID code (column \code{cid}, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem. +#' @details All entries in the \code{\link{antibiotics}} data set have three different identifiers: a human readable EARS-Net code (column \code{ab}, used by ECDC and WHONET), an ATC code (column \code{atc}, used by WHO), and a CID code (column \code{cid}, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem. #' -#' Use the \code{\link{ab_property}} functions to get properties based on the returned ATC code, see Examples. +#' Use the \code{\link{ab_property}} functions to get properties based on the returned antibiotic ID, see Examples. #' #' In the ATC classification system, the active substances are classified in a hierarchy with five different levels. The system has fourteen main anatomical/pharmacological groups or 1st levels. Each ATC main group is divided into 2nd levels which could be either pharmacological or therapeutic groups. The 3rd and 4th levels are chemical, pharmacological or therapeutic subgroups and the 5th level is the chemical substance. The 2nd, 3rd and 4th levels are often used to identify pharmacological subgroups when that is considered more appropriate than therapeutic or chemical subgroups. #' Source: \url{https://www.whocc.no/atc/structure_and_principles/} diff --git a/R/misc.R b/R/misc.R index 8335c362..129d54b5 100755 --- a/R/misc.R +++ b/R/misc.R @@ -147,7 +147,7 @@ search_type_in_df <- function(tbl, type) { if (!is.null(found)) { msg <- paste0("NOTE: Using column `", bold(found), "` as input for `col_", type, "`.") if (type %in% c("keyantibiotics", "specimen")) { - msg <- paste(msg, "Use", bold(paste0("col_", type), " = FALSE"), "to prevent this.") + msg <- paste(msg, "Use", bold(paste0("col_", type), "= FALSE"), "to prevent this.") } message(blue(msg)) } diff --git a/docs/articles/AMR.html b/docs/articles/AMR.html index f1fd8915..db712e20 100644 --- a/docs/articles/AMR.html +++ b/docs/articles/AMR.html @@ -327,9 +327,31 @@
So, we can draw at least two conclusions immediately. From a data scientist perspective, the data looks clean: only values M
and F
. From a researcher 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:
data <- data %>%
@@ -442,14 +442,14 @@
#> Pasteurella multocida (no new changes)
#> Staphylococcus (no new changes)
#> Streptococcus groups A, B, C, G (no new changes)
-#> Streptococcus pneumoniae (1508 new changes)
+#> Streptococcus pneumoniae (1481 new changes)
#> Viridans group streptococci (no new changes)
#>
#> EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes (v3.1, 2016)
-#> Table 01: Intrinsic resistance in Enterobacteriaceae (1335 new changes)
+#> Table 01: Intrinsic resistance in Enterobacteriaceae (1304 new changes)
#> Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria (no new changes)
#> Table 03: Intrinsic resistance in other Gram-negative bacteria (no new changes)
-#> Table 04: Intrinsic resistance in Gram-positive bacteria (2792 new changes)
+#> Table 04: Intrinsic resistance in Gram-positive bacteria (2729 new changes)
#> Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci (no new changes)
#> Table 09: Interpretive rules for B-lactam agents and Gram-negative rods (no new changes)
#> Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins (no new changes)
@@ -457,24 +457,24 @@
#> Table 13: Interpretive rules for quinolones (no new changes)
#>
#> Other rules
-#> Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2206 new changes)
-#> Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (141 new changes)
+#> Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2235 new changes)
+#> Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (125 new changes)
#> Non-EUCAST: piperacillin = R where piperacillin/tazobactam = R (no new changes)
#> Non-EUCAST: piperacillin/tazobactam = S where piperacillin = S (no new changes)
#> Non-EUCAST: trimethoprim = R where trimethoprim/sulfa = R (no new changes)
#> Non-EUCAST: trimethoprim/sulfa = S where trimethoprim = S (no new changes)
#>
#> --------------------------------------------------------------------------
-#> EUCAST rules affected 6,587 out of 20,000 rows, making a total of 7,982 edits
+#> EUCAST rules affected 6,510 out of 20,000 rows, making a total of 7,874 edits
#> => added 0 test results
#>
-#> => changed 7,982 test results
-#> - 102 test results changed from S to I
-#> - 4,844 test results changed from S to R
-#> - 1,047 test results changed from I to S
-#> - 345 test results changed from I to R
-#> - 1,615 test results changed from R to S
-#> - 29 test results changed from R to I
+#> => changed 7,874 test results
+#> - 98 test results changed from S to I
+#> - 4,755 test results changed from S to R
+#> - 1,023 test results changed from I to S
+#> - 326 test results changed from I to R
+#> - 1,654 test results changed from R to S
+#> - 18 test results changed from R to I
#> --------------------------------------------------------------------------
#>
#> Use verbose = TRUE to get a data.frame with all specified edits instead.
So only 28.6% is suitable for resistance analysis! We can now filter on it with the filter()
function, also from the dplyr
package:
So only 28.4% is suitable for resistance analysis! We can now filter on it with the filter()
function, also from the dplyr
package:
For future use, the above two syntaxes can be shortened with the filter_first_isolate()
function:
Only 1 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(.)) %>%
@@ -648,9 +648,9 @@
#> 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.
+#> NOTE: Using column `keyab` as input for `col_keyantibiotics`. Use col_keyantibiotics = FALSE to prevent this.
#> [Criterion] Inclusion based on key antibiotics, ignoring I.
-#> => Found 15,123 first weighted isolates (75.6% of total)
isolate | @@ -667,8 +667,8 @@||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | -2010-02-03 | -Q6 | +2010-01-10 | +T7 | B_ESCHR_COL | S | S | @@ -679,8 +679,8 @@|||||||
2 | -2010-03-18 | -Q6 | +2010-02-24 | +T7 | B_ESCHR_COL | S | S | @@ -692,106 +692,106 @@|||||||
3 | 2010-04-04 | -Q6 | +T7 | B_ESCHR_COL | +R | S | S | -S | -S | -FALSE | +R | FALSE | +TRUE | |
4 | -2010-04-12 | -Q6 | +2010-04-14 | +T7 | B_ESCHR_COL | S | S | -S | +R | S | FALSE | -FALSE | +TRUE | |
5 | -2010-05-08 | -Q6 | +2010-05-20 | +T7 | B_ESCHR_COL | S | S | S | S | FALSE | -FALSE | +TRUE | ||
6 | -2010-08-03 | -Q6 | +2010-09-24 | +T7 | B_ESCHR_COL | -R | +S | S | S | S | FALSE | -TRUE | +FALSE | |
7 | -2010-08-04 | -Q6 | +2010-10-10 | +T7 | B_ESCHR_COL | S | S | S | S | FALSE | -TRUE | +FALSE | ||
8 | -2010-11-02 | -Q6 | +2010-11-17 | +T7 | B_ESCHR_COL | -R | -R | +S | +S | S | S | FALSE | -TRUE | +FALSE |
9 | -2010-11-09 | -Q6 | +2010-12-16 | +T7 | B_ESCHR_COL | -R | +S | S | S | S | FALSE | -TRUE | +FALSE | |
10 | -2010-12-18 | -Q6 | +2011-04-02 | +T7 | B_ESCHR_COL | -R | -R | +I | S | S | -FALSE | +S | +TRUE | TRUE |
Instead of 1, now 6 isolates are flagged. In total, 75.6% of all isolates are marked ‘first weighted’ - 47.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 5 isolates are flagged. In total, 75.8% of all isolates are marked ‘first weighted’ - 47.4% 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:
So we end up with 15,123 isolates for analysis.
+So we end up with 15,158 isolates for analysis.
We can remove unneeded columns:
@@ -799,7 +799,6 @@date | patient_id | hospital | @@ -816,10 +815,39 @@||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | -2014-11-13 | -S2 | -Hospital B | +2017-11-01 | +W7 | +Hospital D | +B_STRPT_PNE | +S | +S | +S | +R | +F | +Gram positive | +Streptococcus | +pneumoniae | +TRUE | +||
2012-09-25 | +R9 | +Hospital A | +B_STRPT_PNE | +S | +S | +S | +R | +F | +Gram positive | +Streptococcus | +pneumoniae | +TRUE | +||||||
2013-05-22 | +V2 | +Hospital A | B_ESCHR_COL | S | S | @@ -832,80 +860,45 @@TRUE | ||||||||||||
3 | -2016-11-12 | -G5 | -Hospital A | -B_KLBSL_PNE | -R | +2017-03-29 | +W6 | +Hospital C | +B_ESCHR_COL | S | S | S | -M | -Gram negative | -Klebsiella | -pneumoniae | -TRUE | -|
4 | -2011-09-23 | -U6 | -Hospital A | -B_KLBSL_PNE | -R | -I | -R | S | F | Gram negative | -Klebsiella | -pneumoniae | -TRUE | -|||||
5 | -2010-04-06 | -C9 | -Hospital D | -B_STRPT_PNE | -S | -S | -S | -R | -M | -Gram positive | -Streptococcus | -pneumoniae | +Escherichia | +coli | TRUE | |||
6 | -2012-04-11 | -D2 | -Hospital B | +2017-09-07 | +N7 | +Hospital C | B_STPHY_AUR | -R | S | S | S | -M | +S | +F | Gram positive | Staphylococcus | aureus | TRUE |
8 | -2012-08-17 | -Z4 | -Hospital C | +2012-09-27 | +B7 | +Hospital B | B_ESCHR_COL | -R | S | -R | S | -F | +S | +S | +M | Gram negative | Escherichia | coli | @@ -928,9 +921,9 @@
1 | Escherichia coli | -7,466 | -49.4% | -7,466 | -49.4% | +7,500 | +49.5% | +7,500 | +49.5% | |||||||||
2 | Staphylococcus aureus | -3,649 | -24.1% | -11,115 | -73.5% | +3,761 | +24.8% | +11,261 | +74.3% | |||||||||
3 | Streptococcus pneumoniae | -2,381 | -15.7% | -13,496 | -89.2% | +2,297 | +15.2% | +13,558 | +89.4% | |||||||||
4 | Klebsiella pneumoniae | -1,627 | -10.8% | -15,123 | +1,600 | +10.6% | +15,158 | 100.0% |
hospital | @@ -997,26 +990,26 @@ Longest: 24||
---|---|---|
Hospital A | -0.5100641 | +0.4757516 |
Hospital B | -0.4945632 | +0.4728817 |
Hospital C | -0.4960457 | +0.4581554 |
Hospital D | -0.5036765 | +0.4717349 |
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 = portion_IR(AMX),
+ summarise(amoxicillin = portion_R(AMX),
available = n_rsi(AMX))
Hospital A | -0.5100641 | -4521 | +0.4757516 | +4557 |
Hospital B | -0.4945632 | -5334 | +0.4728817 | +5181 |
Hospital C | -0.4960457 | -2276 | +0.4581554 | +2342 |
Hospital D | -0.5036765 | -2992 | +0.4717349 | +3078 |
These functions can also be used to get the portion of multiple antibiotics, to calculate empiric susceptibility of combination therapies very easily:
data_1st %>%
group_by(genus) %>%
- summarise(amoxiclav = portion_S(AMC),
- gentamicin = portion_S(GEN),
- amoxiclav_genta = portion_S(AMC, GEN))
genus | @@ -1063,36 +1056,36 @@ Longest: 24||||||
---|---|---|---|---|---|---|
Escherichia | -0.8775784 | -0.8984731 | -0.9910260 | +0.9216000 | +0.8910667 | +0.9924000 |
Klebsiella | -0.7221881 | -0.9053473 | -0.9778734 | +0.8250000 | +0.9018750 | +0.9893750 |
Staphylococcus | -0.8766785 | -0.9188819 | -0.9887640 | +0.9215634 | +0.9175751 | +0.9936187 |
Streptococcus | -0.5732885 | +0.6081846 | 0.0000000 | -0.5732885 | +0.6081846 |
To make a transition to the next part, let’s see how this difference could be plotted:
data_1st %>%
group_by(genus) %>%
- summarise("1. Amoxi/clav" = portion_S(AMC),
- "2. Gentamicin" = portion_S(GEN),
- "3. Amoxi/clav + GEN" = portion_S(AMC, GEN)) %>%
+ summarise("1. Amoxi/clav" = portion_SI(AMC),
+ "2. Gentamicin" = portion_SI(GEN),
+ "3. Amoxi/clav + genta" = portion_SI(AMC, GEN)) %>%
tidyr::gather("Antibiotic", "S", -genus) %>%
ggplot(aes(x = genus,
y = S,
@@ -1134,7 +1127,7 @@ Longest: 24
scale_rsi_colours() +
# show percentages on y axis
scale_y_percent(breaks = 0:4 * 25) +
- # turn 90 degrees, make it bars instead of columns
+ # turn 90 degrees, to make it bars instead of columns
coord_flip() +
# add labels
labs(title = "Resistance per genus and antibiotic",
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 2ee99121..4e242fe4 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 f76f6eb4..eb31b19a 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 a634df72..6a52a798 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 47476b9e..1e18d0fa 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/reference/as.ab.html b/docs/reference/as.ab.html
index cf428083..4ef255d8 100644
--- a/docs/reference/as.ab.html
+++ b/docs/reference/as.ab.html
@@ -260,8 +260,8 @@
Details
- All entries in the {link{antibiotics}
data set have three different identifiers: a human readable EARS-Net code (column ab
, used by ECDC and WHONET), an ATC code (column atc
, used by WHO), and a CID code (column cid
, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem.
-Use the ab_property
functions to get properties based on the returned ATC code, see Examples.
+ All entries in the antibiotics
data set have three different identifiers: a human readable EARS-Net code (column ab
, used by ECDC and WHONET), an ATC code (column atc
, used by WHO), and a CID code (column cid
, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem.
+Use the ab_property
functions to get properties based on the returned antibiotic ID, see Examples.
In the ATC classification system, the active substances are classified in a hierarchy with five different levels. The system has fourteen main anatomical/pharmacological groups or 1st levels. Each ATC main group is divided into 2nd levels which could be either pharmacological or therapeutic groups. The 3rd and 4th levels are chemical, pharmacological or therapeutic subgroups and the 5th level is the chemical substance. The 2nd, 3rd and 4th levels are often used to identify pharmacological subgroups when that is considered more appropriate than therapeutic or chemical subgroups.
Source: https://www.whocc.no/atc/structure_and_principles/
diff --git a/man/as.ab.Rd b/man/as.ab.Rd
index 5dd468f2..55760474 100644
--- a/man/as.ab.Rd
+++ b/man/as.ab.Rd
@@ -19,9 +19,9 @@ Character (vector) with class \code{"ab"}. Unknown values will return \code{NA}.
Use this function to determine the antibiotic code of one or more antibiotics. The data set \code{\link{antibiotics}} will be searched for abbreviations, official names and synonyms (brand names).
}
\details{
-All entries in the \code{\{link{antibiotics}} data set have three different identifiers: a human readable EARS-Net code (column \code{ab}, used by ECDC and WHONET), an ATC code (column \code{atc}, used by WHO), and a CID code (column \code{cid}, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem.
+All entries in the \code{\link{antibiotics}} data set have three different identifiers: a human readable EARS-Net code (column \code{ab}, used by ECDC and WHONET), an ATC code (column \code{atc}, used by WHO), and a CID code (column \code{cid}, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem.
-Use the \code{\link{ab_property}} functions to get properties based on the returned ATC code, see Examples.
+Use the \code{\link{ab_property}} functions to get properties based on the returned antibiotic ID, see Examples.
In the ATC classification system, the active substances are classified in a hierarchy with five different levels. The system has fourteen main anatomical/pharmacological groups or 1st levels. Each ATC main group is divided into 2nd levels which could be either pharmacological or therapeutic groups. The 3rd and 4th levels are chemical, pharmacological or therapeutic subgroups and the 5th level is the chemical substance. The 2nd, 3rd and 4th levels are often used to identify pharmacological subgroups when that is considered more appropriate than therapeutic or chemical subgroups.
Source: \url{https://www.whocc.no/atc/structure_and_principles/}
diff --git a/vignettes/AMR.Rmd b/vignettes/AMR.Rmd
index 12b80a26..b30f1609 100755
--- a/vignettes/AMR.Rmd
+++ b/vignettes/AMR.Rmd
@@ -315,10 +315,10 @@ data_1st %>%
## Resistance percentages
-The functions `portion_S()`, `portion_SI()`, `portion_I()`, `portion_IR()` and `portion_R()` can be used to determine the portion of a specific antimicrobial outcome. They can be used on their own:
+The functions `portion_S()`, `portion_SI()`, `portion_I()`, `portion_IR()` and `portion_R()` can be used to determine the portion of a specific antimicrobial outcome. As per the EUCAST guideline of 2019, we calculate resistance as the portion of R (`portion_R()`) and susceptibility as the portion of S and I (`portion_SI()`). These functions can be used on their own:
```{r}
-data_1st %>% portion_IR(AMX)
+data_1st %>% portion_R(AMX)
```
Or can be used in conjuction with `group_by()` and `summarise()`, both from the `dplyr` package:
@@ -326,12 +326,12 @@ Or can be used in conjuction with `group_by()` and `summarise()`, both from the
```{r, eval = FALSE}
data_1st %>%
group_by(hospital) %>%
- summarise(amoxicillin = portion_IR(AMX))
+ summarise(amoxicillin = portion_R(AMX))
```
```{r, echo = FALSE}
data_1st %>%
group_by(hospital) %>%
- summarise(amoxicillin = portion_IR(AMX)) %>%
+ summarise(amoxicillin = portion_R(AMX)) %>%
knitr::kable(align = "c", big.mark = ",")
```
@@ -340,13 +340,13 @@ Of course it would be very convenient to know the number of isolates responsible
```{r, eval = FALSE}
data_1st %>%
group_by(hospital) %>%
- summarise(amoxicillin = portion_IR(AMX),
+ summarise(amoxicillin = portion_R(AMX),
available = n_rsi(AMX))
```
```{r, echo = FALSE}
data_1st %>%
group_by(hospital) %>%
- summarise(amoxicillin = portion_IR(AMX),
+ summarise(amoxicillin = portion_R(AMX),
available = n_rsi(AMX)) %>%
knitr::kable(align = "c", big.mark = ",")
```
@@ -356,16 +356,16 @@ These functions can also be used to get the portion of multiple antibiotics, to
```{r, eval = FALSE}
data_1st %>%
group_by(genus) %>%
- summarise(amoxiclav = portion_S(AMC),
- gentamicin = portion_S(GEN),
- amoxiclav_genta = portion_S(AMC, GEN))
+ summarise(amoxiclav = portion_SI(AMC),
+ gentamicin = portion_SI(GEN),
+ amoxiclav_genta = portion_SI(AMC, GEN))
```
```{r, echo = FALSE}
data_1st %>%
group_by(genus) %>%
- summarise(amoxiclav = portion_S(AMC),
- gentamicin = portion_S(GEN),
- amoxiclav_genta = portion_S(AMC, GEN)) %>%
+ summarise(amoxiclav = portion_SI(AMC),
+ gentamicin = portion_SI(GEN),
+ amoxiclav_genta = portion_SI(AMC, GEN)) %>%
knitr::kable(align = "c", big.mark = ",")
```
@@ -374,9 +374,9 @@ To make a transition to the next part, let's see how this difference could be pl
```{r plot 1}
data_1st %>%
group_by(genus) %>%
- summarise("1. Amoxi/clav" = portion_S(AMC),
- "2. Gentamicin" = portion_S(GEN),
- "3. Amoxi/clav + GEN" = portion_S(AMC, GEN)) %>%
+ summarise("1. Amoxi/clav" = portion_SI(AMC),
+ "2. Gentamicin" = portion_SI(GEN),
+ "3. Amoxi/clav + genta" = portion_SI(AMC, GEN)) %>%
tidyr::gather("Antibiotic", "S", -genus) %>%
ggplot(aes(x = genus,
y = S,
@@ -426,7 +426,7 @@ ggplot(data_1st %>% group_by(genus)) +
scale_rsi_colours() +
# show percentages on y axis
scale_y_percent(breaks = 0:4 * 25) +
- # turn 90 degrees, make it bars instead of columns
+ # turn 90 degrees, to make it bars instead of columns
coord_flip() +
# add labels
labs(title = "Resistance per genus and antibiotic",