Functions to simplify and standardise antimicrobial resistance (AMR) data analysis and to work with microbial and antimicrobial properties by using evidence-based methods, as described in https://doi.org/10.18637/jss.v104.i03.
Notice how "Using column 'mo' as input for mo_name()" is mentioned 4 times, the number of the groups:
library(AMR)
library(dplyr)
example_isolates |> group_by(hospital_id) |> transmute(name = mo_name())
#> ℹ Using column 'mo' as input for `mo_name()`
#> ℹ Using column 'mo' as input for `mo_name()`
#> ℹ Using column 'mo' as input for `mo_name()`
#> ℹ Using column 'mo' as input for `mo_name()`
#> # A tibble: 2,000 × 2
#> # Groups: hospital_id [4]
#> hospital_id name
#> <fct> <chr>
#> 1 D Escherichia coli
#> 2 D Escherichia coli
#> 3 B Staphylococcus epidermidis
#> 4 B Staphylococcus epidermidis
#> 5 B Staphylococcus epidermidis
#> 6 B Staphylococcus epidermidis
#> 7 D Staphylococcus aureus
#> 8 D Staphylococcus aureus
#> 9 B Staphylococcus epidermidis
#> 10 B Staphylococcus epidermidis
#> # … with 1,990 more rows
#> # ℹ Use `print(n = ...)` to see more rows
Notice how "Using column 'mo' as input for
mo_name()
" is mentioned 4 times, the number of the groups:Created on 2022-08-08 by the reprex package (v2.0.1)