1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-10 18:21:54 +02:00

(v2.1.1.9231) Update EUCAST vignette

This commit is contained in:
2025-03-29 18:03:31 +01:00
parent b972bbb96f
commit 5f5b77bfaf
6 changed files with 51 additions and 57 deletions

View File

@ -24,12 +24,12 @@ knitr::opts_chunk$set(
> This page was entirely written by our [AMR for R Assistant](https://chatgpt.com/g/g-M4UNLwFi5-amr-for-r-assistant), a ChatGPT manually-trained model able to answer any question about the AMR package.
---
Antimicrobial resistance (AMR) is a global health crisis, and understanding resistance patterns is crucial for managing effective treatments. The `AMR` R package provides robust tools for analysing AMR data, including convenient antimicrobial selector functions like `aminoglycosides()` and `betalactams()`.
In this post, we will explore how to use the `tidymodels` framework to predict resistance patterns in the `example_isolates` dataset in two examples.
## Example 1: Using Antimicrobial Selectors
Antimicrobial resistance (AMR) is a global health crisis, and understanding resistance patterns is crucial for managing effective treatments. The `AMR` R package provides robust tools for analysing AMR data, including convenient antimicrobial selector functions like `aminoglycosides()` and `betalactams()`. In this post, we will explore how to use the `tidymodels` framework to predict resistance patterns in the `example_isolates` dataset.
By leveraging the power of `tidymodels` and the `AMR` package, well build a reproducible machine learning workflow to predict the Gramstain of the microorganism to two important antibiotic classes: aminoglycosides and beta-lactams.
### **Objective**
@ -329,9 +329,9 @@ metrics_time
- `predict()`: Generates resistance predictions.
- `metrics()`: Evaluates model performance.
### **Visualizing Predictions**
### **Visualising Predictions**
We plot resistance trends over time for Amoxicillin.
We plot resistance trends over time for amoxicillin.
```{r}
library(ggplot2)
@ -346,7 +346,7 @@ ggplot(predictions_time, aes(x = year)) +
theme_minimal()
```
Additionally, we can visualise resistance trends in `ggplot2` and directly adding linear models there:
Additionally, we can visualise resistance trends in `ggplot2` and directly add linear models there:
```{r}
ggplot(data_time, aes(x = year, y = res_AMX, color = gramstain)) +