Skip to contents

This is an overview of all the package-specific options() you can set in the AMR package.

Options

  • AMR_custom_ab
    Allows to use custom antimicrobial drugs with this package. This is explained in add_custom_antimicrobials().

  • AMR_custom_mo
    Allows to use custom microorganisms with this package. This is explained in add_custom_microorganisms().

  • AMR_eucastrules
    Used for setting the default types of rules for eucast_rules() function, must be one or more of: "breakpoints", "expert", "other", "custom", "all", and defaults to c("breakpoints", "expert").

  • AMR_guideline
    Used for setting the default guideline for interpreting MIC values and disk diffusion diameters with as.sir(). Can be only the guideline name (e.g., "CLSI") or the name with a year (e.g. "CLSI 2019"). The default is "EUCAST 2022". Supported guideline are currently EUCAST (2013-2022) and CLSI (2013-2022).

  • AMR_ignore_pattern
    A regular expression to define input that must be ignored in as.mo() and all mo_* functions.

  • AMR_include_PKPD
    A logical to use in as.sir(), to indicate that PK/PD clinical breakpoints must be applied as a last resort, defaults to TRUE.

  • AMR_keep_synonyms
    A logical to use in as.mo() and all mo_* functions, to indicate if old, previously valid taxonomic names must be preserved and not be corrected to currently accepted names.

  • AMR_locale
    A language to use for the AMR package, can be one of these supported language names or ISO-639-1 codes: English (en), Chinese (zh), Danish (da), Dutch (nl), French (fr), German (de), Greek (el), Italian (it), Japanese (ja), Polish (pl), Portuguese (pt), Russian (ru), Spanish (es), Swedish (sv), Turkish (tr) or Ukrainian (uk).

  • AMR_mo_source
    A file location for a manual code list to be used in as.mo() and all mo_* functions. This is explained in set_mo_source().

Saving Settings Between Sessions

Settings in R are not saved globally and are thus lost when R is exited. You can save your options to your own .Rprofile file, which is a user-specific file. You can edit it using:

  utils::file.edit("~/.Rprofile")

In this file, you can set options such as options(AMR_locale = "pt") for Portuguese language support of antibiotics.

Share Options Within Team

For a more global approach, e.g. within a data team, save an options file to a remote file location, such as a shared network drive. This would work in this way:

  1. Save a plain text file to e.g. "X:/team_folder/R_options.R" and fill it with preferred settings.

  2. For each user, open the .Rprofile file using utils::file.edit("~/.Rprofile") and put in there:

      source("X:/team_folder/R_options.R")

  3. Reload R/RStudio and check the settings with getOption(), e.g. getOption("AMR_locale") if you have set that value.

Now the team settings are configured in only one place, and can be maintained there.