Cleaning your data

Functions for cleaning and optimising your data, to be able to add variables later on (like taxonomic properties) or to fix and extend antibiotic interpretations by applying EUCAST rules.

as.ab() is.ab()

Transform to antibiotic ID

as.disk() is.disk()

Class 'disk'

as.mic() is.mic()

Class 'mic'

as.mo() is.mo() mo_failures() mo_uncertainties() mo_renamed()

Transform to microorganism ID

as.rsi() is.rsi() is.rsi.eligible()

Class 'rsi'

eucast_rules()

Apply EUCAST rules

ab_from_text()

Retrieve antimicrobial drug names and doses from clinical text

guess_ab_col()

Guess antibiotic column

set_mo_source() get_mo_source()

User-defined reference data set for microorganisms

Enhancing your data

Functions to add new data to your existing data, such as the determination of first isolates, multi-drug resistant microorganisms (MDRO), getting properties of microorganisms or antibiotics and determining the age of patients or divide ages into age groups.

ab_name() ab_atc() ab_cid() ab_synonyms() ab_tradenames() ab_group() ab_atc_group1() ab_atc_group2() ab_loinc() ab_ddd() ab_info() ab_url() ab_property()

Property of an antibiotic

age_groups()

Split ages into age groups

age()

Age in years of individuals

atc_online_property() atc_online_groups() atc_online_ddd()

Get ATC properties from WHOCC website

first_isolate() filter_first_isolate() filter_first_weighted_isolate()

Determine first (weighted) isolates

inner_join_microorganisms() left_join_microorganisms() right_join_microorganisms() full_join_microorganisms() semi_join_microorganisms() anti_join_microorganisms()

Join microorganisms to a data set

key_antibiotics() key_antibiotics_equal()

Key antibiotics for first weighted isolates

mdro() brmo() mrgn() mdr_tb() mdr_cmi2012() eucast_exceptional_phenotypes()

Determine multidrug-resistant organisms (MDRO)

mo_name() mo_fullname() mo_shortname() mo_subspecies() mo_species() mo_genus() mo_family() mo_order() mo_class() mo_phylum() mo_kingdom() mo_domain() mo_type() mo_gramstain() mo_snomed() mo_ref() mo_authors() mo_year() mo_rank() mo_taxonomy() mo_synonyms() mo_info() mo_url() mo_property()

Property of a microorganism

p_symbol()

Symbol of a p-value

Analysing your data

Functions for conducting AMR analysis, like counting isolates, calculating resistance or susceptibility, or make plots.

resistance() susceptibility() proportion_R() proportion_IR() proportion_I() proportion_SI() proportion_S() proportion_df() rsi_df()

Calculate microbial resistance

count_resistant() count_susceptible() count_R() count_IR() count_I() count_SI() count_S() count_all() n_rsi() count_df()

Count available isolates

availability()

Check availability of columns

bug_drug_combinations() format(<bug_drug_combinations>)

Determine bug-drug combinations

resistance_predict() rsi_predict() plot(<resistance_predict>) ggplot_rsi_predict()

Predict antimicrobial resistance

pca()

Principal Component Analysis (for AMR)

ab_class() aminoglycosides() carbapenems() cephalosporins() cephalosporins_1st() cephalosporins_2nd() cephalosporins_3rd() cephalosporins_4th() cephalosporins_5th() fluoroquinolones() glycopeptides() macrolides() penicillins() tetracyclines()

Antibiotic class selectors

filter_ab_class() filter_aminoglycosides() filter_carbapenems() filter_cephalosporins() filter_1st_cephalosporins() filter_2nd_cephalosporins() filter_3rd_cephalosporins() filter_4th_cephalosporins() filter_5th_cephalosporins() filter_fluoroquinolones() filter_glycopeptides() filter_macrolides() filter_penicillins() filter_tetracyclines()

Filter isolates on result in antimicrobial class

g.test()

G-test for Count Data

ggplot_rsi() geom_rsi() facet_rsi() scale_y_percent() scale_rsi_colours() theme_rsi() labels_rsi_count()

AMR plots with ggplot2

ggplot_pca()

PCA biplot with ggplot2

kurtosis()

Kurtosis of the sample

skewness()

Skewness of the sample

Included data sets

Scientifically reliable references for microorganisms and antibiotics, and example data sets to use for practise.

microorganisms

Data set with 67,151 microorganisms

antibiotics antivirals

Data sets with 558 antimicrobials

example_isolates

Data set with 2,000 example isolates

example_isolates_unclean

Data set with unclean data

rsi_translation

Data set for R/SI interpretation

microorganisms.codes

Translation table with 5,582 common microorganism codes

microorganisms.old

Data set with previously accepted taxonomic names

WHONET

Data set with 500 isolates - WHONET example

Background information

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.

AMR

The AMR Package

catalogue_of_life

The Catalogue of Life

catalogue_of_life_version()

Version info of included Catalogue of Life

WHOCC

WHOCC: WHO Collaborating Centre for Drug Statistics Methodology

lifecycle

Lifecycles of functions in the AMR package

Other 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) {...}.

get_locale()

Translate strings from AMR package

like() `%like%` `%like_case%`

Pattern Matching

Deprecated functions

These functions are deprecated, meaning that they will still work but show a warning with every use and will be removed in a future version.

portion_R() portion_IR() portion_I() portion_SI() portion_S() portion_df()

Deprecated functions