Compare commits

..

3 Commits

70 changed files with 269 additions and 182 deletions

6
.gitattributes vendored
View File

@ -1,6 +0,0 @@
*.dta filter=lfs diff=lfs merge=lfs -text
*.sas filter=lfs diff=lfs merge=lfs -text
*.sav filter=lfs diff=lfs merge=lfs -text
data-raw/*.dta filter=lfs diff=lfs merge=lfs -text
data-raw/*.sas filter=lfs diff=lfs merge=lfs -text
data-raw/*.sav filter=lfs diff=lfs merge=lfs -text

View File

@ -1,3 +0,0 @@
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-checkout.\n"; exit 2; }
git lfs post-checkout "$@"

View File

@ -1,3 +0,0 @@
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-commit.\n"; exit 2; }
git lfs post-commit "$@"

View File

@ -1,3 +0,0 @@
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-merge.\n"; exit 2; }
git lfs post-merge "$@"

View File

@ -5,13 +5,13 @@ echo "Running pre-commit hook..."
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo ">> Updating R documentation..." echo ">> Updating R documentation..."
if command -v Rscript > /dev/null; then if command -v Rscript > /dev/null; then
if [ "$(Rscript -e 'cat(all(c('"'roxygen2'"', '"'pkgload'"') %in% rownames(installed.packages())))')" = "TRUE" ]; then if [ "$(Rscript -e 'cat(all(c('"'pkgload'"', '"'devtools'"', '"'dplyr'"') %in% rownames(installed.packages())))')" = "TRUE" ]; then
Rscript -e "suppressMessages(roxygen2::roxygenise())" Rscript -e "source('data-raw/pre-commit-hook.R')"
currentpkg=`Rscript -e "cat(pkgload::pkg_name())"` currentpkg=`Rscript -e "cat(pkgload::pkg_name())"`
git add man/* git add man/*
echo ">> done." git add R/sysdata.rda
else else
echo ">> R packages 'roxygen2' and 'pkgload' are not installed!" echo ">> R package 'pkgload', 'devtools', or 'dplyr' not installed!"
currentpkg="your" currentpkg="your"
fi fi
else else
@ -30,7 +30,7 @@ currenttagfull=`git describe --tags --abbrev=0`
currenttag=`git describe --tags --abbrev=0 | sed 's/v//'` currenttag=`git describe --tags --abbrev=0 | sed 's/v//'`
if [ "$currenttag" = "" ]; then if [ "$currenttag" = "" ]; then
# there is no tag, so set tag to 0.0.1 and commit index to current count # there is no tag, so set tag to 0.0.1 and commit index to current count
echo ">> - no git tags found, create some using v(x).(y).(z)" echo ">> - no git tags found, create one in this format: 'v(x).(y).(z)'!"
currenttag="0.0.1" currenttag="0.0.1"
currentcommit=`git rev-list --count HEAD` currentcommit=`git rev-list --count HEAD`
else else

View File

@ -1,71 +0,0 @@
#!/bin/sh
echo "Running pre-commit hook..."
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo ">> Updating R documentation..."
if command -v Rscript > /dev/null; then
if [ "$(Rscript -e 'cat(all(c('"'roxygen2'"', '"'pkgload'"') %in% rownames(installed.packages())))')" = "TRUE" ]; then
Rscript -e "suppressMessages(roxygen2::roxygenise())"
currentpkg=`Rscript -e "cat(pkgload::pkg_name())"`
git add man/*
echo ">> done."
else
echo ">> R packages 'roxygen2' and 'pkgload' are not installed!"
currentpkg="your"
fi
else
echo ">> R is not available on your system!"
currentpkg="your"
fi
echo ">> "
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo ">> Updating semantic versioning and date..."
# get tags from remote, and remove tags not on remote:
git fetch origin --prune --prune-tags --quiet
currenttagfull=`git describe --tags --abbrev=0`
currenttag=`git describe --tags --abbrev=0 | sed 's/v//'`
if [ "$currenttag" = "" ]; then
# there is no tag, so set tag to 0.0.1 and commit index to current count
echo ">> - no git tags found, create some using v(x).(y).(z)"
currenttag="0.0.1"
currentcommit=`git rev-list --count HEAD`
else
# there is a tag, so base version number on that
currentcommit=`git rev-list --count ${currenttagfull}..HEAD`
if (( "$currentcommit" == 0 )); then
# tag is new, so this must become the version number
currentversion="$currenttag"
fi
echo ">> - latest tag is '${currenttagfull}', with ${currentcommit} previous commits"
fi
if [ "$currentversion" = "" ]; then
# combine tag (e.g. 1.2.3) and commit number (like 5) increased by 9000 to indicate beta version
currentversion="$currenttag.$((currentcommit + 9001))" # results in e.g. 1.2.3.9005
fi
echo ">> - ${currentpkg} pkg version set to ${currentversion}"
# set version number and date to DESCRIPTION file
sed -i -- "s/^Version: .*/Version: ${currentversion}/" DESCRIPTION
sed -i -- "s/^Date: .*/Date: $(date '+%Y-%m-%d')/" DESCRIPTION
echo ">> - updated DESCRIPTION"
# remove leftover on macOS
rm -f DESCRIPTION--
# add to commit
git add DESCRIPTION
# set version number to NEWS file
if [ -e "NEWS.md" ]; then
sed -i -- "1s/.*/# ${currentpkg} ${currentversion}/" NEWS.md
echo ">> - updated NEWS.md"
# remove leftover on macOS
rm -f NEWS.md--
# add to commit
git add NEWS.md
else
echo ">> - no NEWS.md found!"
fi
echo ">> "

View File

@ -1,3 +0,0 @@
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/pre-push.\n"; exit 2; }
git lfs pre-push "$@"

78
.github/workflows/check-pr.yaml vendored Normal file
View File

@ -0,0 +1,78 @@
# ==================================================================== #
# TITLE #
# Antimicrobial Resistance (AMR) Data Analysis for R #
# #
# SOURCE #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2022 Berends MS, Luz CF et al. #
# Developed at the University of Groningen, the Netherlands, in #
# collaboration with non-profit organisations Certe Medical #
# Diagnostics & Advice, and University Medical Center Groningen. #
# #
# This R package is free software; you can freely use and distribute #
# it for both personal and commercial purposes under the terms of the #
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
# the Free Software Foundation. #
# We created this package for both routine data analysis and academic #
# research and it was publicly released in the hope that it will be #
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
# #
# Visit our website for the full manual and a complete tutorial about #
# how to conduct AMR data analysis: https://msberends.github.io/AMR/ #
# ==================================================================== #
on:
pull_request:
# run in each PR in this repo
branches: '**'
name: R-code-check-PR
jobs:
R-code-check-PR:
runs-on: ${{ matrix.config.os }}
continue-on-error: ${{ matrix.config.allowfail }}
name: ${{ matrix.config.os }} (R-${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'devel', allowfail: true}
- {os: macOS-latest, r: 'release', allowfail: false}
- {os: ubuntu-latest, r: 'devel', allowfail: true}
- {os: ubuntu-latest, r: 'release', allowfail: false}
- {os: windows-latest, r: 'devel', allowfail: true}
- {os: windows-latest, r: 'release', allowfail: false}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
# use RStudio Package Manager to quickly install packages
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check
- uses: r-lib/actions/check-r-package@v2
env:
_R_CHECK_LENGTH_1_CONDITION_: verbose
_R_CHECK_LENGTH_1_LOGIC2_: verbose
# during 'R CMD check', R_LIBS_USER will be overwritten, so:
R_LIBS_USER_GH_ACTIONS: ${{ env.R_LIBS_USER }}
R_RUN_TINYTEST: true

View File

@ -48,6 +48,7 @@ jobs:
config: config:
# test all systems against all released versions of R >= 3.0, we support them all! # test all systems against all released versions of R >= 3.0, we support them all!
- {os: macOS-latest, r: 'devel', allowfail: true} - {os: macOS-latest, r: 'devel', allowfail: true}
- {os: macOS-latest, r: '4.2', allowfail: false}
- {os: macOS-latest, r: '4.1', allowfail: false} - {os: macOS-latest, r: '4.1', allowfail: false}
- {os: macOS-latest, r: '4.0', allowfail: false} - {os: macOS-latest, r: '4.0', allowfail: false}
- {os: macOS-latest, r: '3.6', allowfail: false} - {os: macOS-latest, r: '3.6', allowfail: false}
@ -63,6 +64,7 @@ jobs:
- {os: ubuntu-22.04, r: '3.1', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"} - {os: ubuntu-22.04, r: '3.1', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"}
- {os: ubuntu-22.04, r: '3.0', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"} - {os: ubuntu-22.04, r: '3.0', allowfail: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"}
- {os: windows-latest, r: 'devel', allowfail: true} - {os: windows-latest, r: 'devel', allowfail: true}
- {os: windows-latest, r: '4.2', allowfail: false}
- {os: windows-latest, r: '4.1', allowfail: false} - {os: windows-latest, r: '4.1', allowfail: false}
- {os: windows-latest, r: '4.0', allowfail: false} - {os: windows-latest, r: '4.0', allowfail: false}
- {os: windows-latest, r: '3.6', allowfail: false} - {os: windows-latest, r: '3.6', allowfail: false}
@ -72,7 +74,7 @@ jobs:
R_REPOSITORIES: "https://cran.rstudio.com" R_REPOSITORIES: "https://cran.rstudio.com"
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2 - uses: r-lib/actions/setup-r@v2
with: with:

View File

@ -25,12 +25,9 @@
on: on:
push: push:
branches: branches: '**'
- development
- main
pull_request: pull_request:
branches: branches: '**'
- main
name: code-coverage name: code-coverage
@ -40,7 +37,7 @@ jobs:
env: env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2 - uses: r-lib/actions/setup-r@v2
with: with:

View File

@ -25,12 +25,9 @@
on: on:
push: push:
branches: branches: '**'
- development
- main
pull_request: pull_request:
branches: branches: '**'
- main
name: lintr name: lintr
@ -40,7 +37,7 @@ jobs:
env: env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2 - uses: r-lib/actions/setup-r@v2

1
.gitignore vendored
View File

@ -5,7 +5,6 @@ doc
.Rhistory .Rhistory
.RData .RData
.Ruserdata .Ruserdata
AMR.Rproj
tests/testthat/Rplots.pdf tests/testthat/Rplots.pdf
inst/doc inst/doc
/src/*.o /src/*.o

22
AMR.Rproj Normal file
View File

@ -0,0 +1,22 @@
Version: 1.0
RestoreWorkspace: No
SaveWorkspace: Ask
AlwaysSaveHistory: Yes
EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX
AutoAppendNewline: Yes
BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageBuildArgs: --no-build-vignettes
PackageCheckArgs: --no-build-vignettes --as-cran
PackageRoxygenize: rd,collate,namespace

View File

@ -1,5 +1,5 @@
Package: AMR Package: AMR
Version: 1.8.1.9027 Version: 1.8.1.9030
Date: 2022-08-26 Date: 2022-08-26
Title: Antimicrobial Resistance Data Analysis Title: Antimicrobial Resistance Data Analysis
Description: Functions to simplify and standardise antimicrobial resistance (AMR) Description: Functions to simplify and standardise antimicrobial resistance (AMR)

View File

@ -1,11 +1,12 @@
# AMR 1.8.1.9027 # AMR 1.8.1.9030
### New ### New
* EUCAST 2022 and CLSI 2022 guidelines have been added for `as.rsi()`. EUCAST 2022 is now the new default guideline for all MIC and disks diffusion interpretations. * EUCAST 2022 and CLSI 2022 guidelines have been added for `as.rsi()`. EUCAST 2022 is now the new default guideline for all MIC and disks diffusion interpretations.
* Support for the following languages: Chinese, Greek, Japanese, Polish, Turkish and Ukrainian. The `AMR` package is now available in 16 languages. * Support for the following languages: Chinese, Greek, Japanese, Polish, Turkish and Ukrainian. The `AMR` package is now available in 16 languages.
### Changed ### Changed
* Fix for `as.rsi()` on certain EUCAST breakpoints for MIC values * Fix for using `as.rsi()` on certain EUCAST breakpoints for MIC values
* Fix for using `as.rsi()` on `NA` values (e.g. `as.rsi(as.disk(NA), ...)`)
* Removed `as.integer()` for MIC values, since MIC are not integer values and running `table()` on MIC values consequently failed for not being able to retrieve the level position (as that's how normally `as.integer()` on `factor`s work) * Removed `as.integer()` for MIC values, since MIC are not integer values and running `table()` on MIC values consequently failed for not being able to retrieve the level position (as that's how normally `as.integer()` on `factor`s work)
* `droplevels()` on MIC will now return a common `factor` at default and will lose the `<mic>` class. Use `droplevels(..., as.mic = TRUE)` to keep the `<mic>` class. * `droplevels()` on MIC will now return a common `factor` at default and will lose the `<mic>` class. Use `droplevels(..., as.mic = TRUE)` to keep the `<mic>` class.
* Small fix for using `ab_from_text()` * Small fix for using `ab_from_text()`
@ -19,6 +20,9 @@
### Other ### Other
* New website to make use of the new Bootstrap 5 and pkgdown v2.0. The website now contains results for all examples and will be automatically regenerated with every change to our repository, using GitHub Actions * New website to make use of the new Bootstrap 5 and pkgdown v2.0. The website now contains results for all examples and will be automatically regenerated with every change to our repository, using GitHub Actions
* Added Peter Dutey-Magni and Anton Mymrikov as contributors, to thank them for their valuable input * Added Peter Dutey-Magni and Anton Mymrikov as contributors, to thank them for their valuable input
* Our data sets are now also continually exported to Apache Feather and Apache Parquet formats
* Set up Git Large File Storage (Git LFS) for the large SAS and SPSS file formats
# `AMR` 1.8.1 # `AMR` 1.8.1

View File

@ -24,7 +24,7 @@
# ==================================================================== # # ==================================================================== #
# add new version numbers here, and add the rules themselves to "data-raw/eucast_rules.tsv" and rsi_translation # add new version numbers here, and add the rules themselves to "data-raw/eucast_rules.tsv" and rsi_translation
# (sourcing "data-raw/_internals.R" will process the TSV file) # (sourcing "data-raw/pre-commit-hook.R" will process the TSV file)
EUCAST_VERSION_BREAKPOINTS <- list("11.0" = list(version_txt = "v11.0", EUCAST_VERSION_BREAKPOINTS <- list("11.0" = list(version_txt = "v11.0",
year = 2021, year = 2021,
title = "'EUCAST Clinical Breakpoint Tables'", title = "'EUCAST Clinical Breakpoint Tables'",

View File

@ -596,7 +596,7 @@ create_eucast_ab_documentation <- function() {
ab <- character() ab <- character()
for (val in x) { for (val in x) {
if (paste0("AB_", val) %in% ls(envir = asNamespace("AMR"))) { if (paste0("AB_", val) %in% ls(envir = asNamespace("AMR"))) {
# antibiotic group names, as defined in data-raw/_internals.R, such as `CARBAPENEMS` # antibiotic group names, as defined in data-raw/pre-commit-hook.R, such as `CARBAPENEMS`
val <- eval(parse(text = paste0("AB_", val)), envir = asNamespace("AMR")) val <- eval(parse(text = paste0("AB_", val)), envir = asNamespace("AMR"))
} else if (val %in% AB_lookup$ab) { } else if (val %in% AB_lookup$ab) {
# separate drugs, such as `AMX` # separate drugs, such as `AMX`

View File

@ -502,7 +502,7 @@ ab_select_exec <- function(function_name,
} }
if (is.null(ab_class_args)) { if (is.null(ab_class_args)) {
# their upper case equivalent are vectors with class <ab>, created in data-raw/_internals.R # their upper case equivalent are vectors with class <ab>, created in data-raw/pre-commit-hook.R
# carbapenems() gets its codes from AMR:::AB_CARBAPENEMS # carbapenems() gets its codes from AMR:::AB_CARBAPENEMS
abx <- get(paste0("AB_", toupper(function_name)), envir = asNamespace("AMR")) abx <- get(paste0("AB_", toupper(function_name)), envir = asNamespace("AMR"))
ab_group <- function_name ab_group <- function_name

View File

@ -543,7 +543,7 @@ eucast_rules <- function(x,
# this allows: eucast_rules(x, eucast_rules_df = AMR:::EUCAST_RULES_DF %>% filter(is.na(have_these_values))) # this allows: eucast_rules(x, eucast_rules_df = AMR:::EUCAST_RULES_DF %>% filter(is.na(have_these_values)))
eucast_rules_df <- list(...)$eucast_rules_df eucast_rules_df <- list(...)$eucast_rules_df
} else { } else {
# otherwise internal data file, created in data-raw/_internals.R # otherwise internal data file, created in data-raw/pre-commit-hook.R
eucast_rules_df <- EUCAST_RULES_DF eucast_rules_df <- EUCAST_RULES_DF
} }

View File

@ -311,7 +311,7 @@ get_ab_from_namespace <- function(x, cols_ab) {
x_new <- character() x_new <- character()
for (val in x) { for (val in x) {
if (paste0("AB_", val) %in% ls(envir = asNamespace("AMR"))) { if (paste0("AB_", val) %in% ls(envir = asNamespace("AMR"))) {
# antibiotic group names, as defined in data-raw/_internals.R, such as `AB_CARBAPENEMS` # antibiotic group names, as defined in data-raw/pre-commit-hook.R, such as `AB_CARBAPENEMS`
val <- eval(parse(text = paste0("AB_", val)), envir = asNamespace("AMR")) val <- eval(parse(text = paste0("AB_", val)), envir = asNamespace("AMR"))
} else if (val %in% AB_lookup$ab) { } else if (val %in% AB_lookup$ab) {
# separate drugs, such as `AMX` # separate drugs, such as `AMX`

22
R/rsi.R
View File

@ -597,18 +597,18 @@ get_guideline <- function(guideline, reference_data) {
guideline_param guideline_param
} }
as_rsi_method <- function(method_short = "mic", as_rsi_method <- function(method_short,
method_long = "MIC values", method_long,
x = x, x,
mo = NULL, mo,
ab = deparse(substitute(x)), ab,
guideline = "EUCAST", guideline,
uti = FALSE, uti,
conserve_capped_values = FALSE, conserve_capped_values,
add_intrinsic_resistance = FALSE, add_intrinsic_resistance,
reference_data = AMR::rsi_translation, reference_data,
...) { ...) {
meet_criteria(x) meet_criteria(x, allow_NA = TRUE)
meet_criteria(mo, allow_class = c("mo", "character"), allow_NULL = TRUE) meet_criteria(mo, allow_class = c("mo", "character"), allow_NULL = TRUE)
meet_criteria(ab, allow_class = c("ab", "character")) meet_criteria(ab, allow_class = c("ab", "character"))
meet_criteria(guideline, allow_class = "character", has_length = 1) meet_criteria(guideline, allow_class = "character", has_length = 1)

Binary file not shown.

View File

@ -133,7 +133,7 @@ create_MO_lookup <- function() {
MO_lookup$fullname_lower <- MO_FULLNAME_LOWER MO_lookup$fullname_lower <- MO_FULLNAME_LOWER
} else { } else {
MO_lookup$fullname_lower <- "" MO_lookup$fullname_lower <- ""
warning("MO table updated - Run: source(\"data-raw/_internals.R\")", call. = FALSE) warning("MO table updated - Run: source(\"data-raw/pre-commit-hook.R\")", call. = FALSE)
} }
# add a column with only "e coli" like combinations # add a column with only "e coli" like combinations

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
data-raw/antivirals.feather Normal file

Binary file not shown.

BIN
data-raw/antivirals.parquet Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
data-raw/dosage.feather Normal file

Binary file not shown.

BIN
data-raw/dosage.parquet Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
ec28bed91f4b254e2b33f30b77198325

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -24,7 +24,7 @@
# ==================================================================== # # ==================================================================== #
# Run this file to update the package using: # Run this file to update the package using:
# source("data-raw/_internals.R") # source("data-raw/pre-commit-hook.R")
library(dplyr, warn.conflicts = FALSE) library(dplyr, warn.conflicts = FALSE)
devtools::load_all(quiet = TRUE) devtools::load_all(quiet = TRUE)
@ -55,6 +55,25 @@ EUCAST_RULES_DF <- utils::read.delim(file = "data-raw/eucast_rules.tsv",
mutate(reference.rule_group = as.character(reference.rule_group)) %>% mutate(reference.rule_group = as.character(reference.rule_group)) %>%
select(-sorting_rule) select(-sorting_rule)
TRANSLATIONS <- utils::read.delim(file = "data-raw/translations.tsv",
sep = "\t",
stringsAsFactors = FALSE,
header = TRUE,
blank.lines.skip = TRUE,
fill = TRUE,
strip.white = TRUE,
encoding = "UTF-8",
fileEncoding = "UTF-8",
na.strings = c(NA, "", NULL),
allowEscapes = TRUE, # else "\\1" will be imported as "\\\\1"
quote = "")
LANGUAGES_SUPPORTED_NAMES <- c(list(en = list(exonym = "English", endonym = "English")),
lapply(TRANSLATIONS[, which(nchar(colnames(TRANSLATIONS)) == 2)],
function(x) list(exonym = x[1], endonym = x[2])))
LANGUAGES_SUPPORTED <- names(LANGUAGES_SUPPORTED_NAMES)
# vectors of CoNS and CoPS, improves speed in as.mo() # vectors of CoNS and CoPS, improves speed in as.mo()
create_species_cons_cops <- function(type = c("CoNS", "CoPS")) { create_species_cons_cops <- function(type = c("CoNS", "CoPS")) {
# Determination of which staphylococcal species are CoNS/CoPS according to: # Determination of which staphylococcal species are CoNS/CoPS according to:
@ -190,6 +209,9 @@ AB_LOOKUP <- create_AB_lookup()
# Export to package as internal data ---- # Export to package as internal data ----
usethis::use_data(EUCAST_RULES_DF, usethis::use_data(EUCAST_RULES_DF,
TRANSLATIONS,
LANGUAGES_SUPPORTED_NAMES,
LANGUAGES_SUPPORTED,
MO_CONS, MO_CONS,
MO_COPS, MO_COPS,
MO_STREP_ABCG, MO_STREP_ABCG,
@ -232,22 +254,34 @@ usethis::use_data(EUCAST_RULES_DF,
# Export data sets to the repository in different formats ----------------- # Export data sets to the repository in different formats -----------------
for (pkg in c("haven", "openxlsx", "arrow")) {
if (!pkg %in% rownames(utils::installed.packages())) {
message("NOTE: package '", pkg, "' not installed! Ignoring export where this package is required.")
}
}
if ("digest" %in% rownames(utils::installed.packages())) {
md5 <- function(object) digest::digest(object, "md5")
} else {
# will write all files anyway, since MD5 hash cannot be determined
md5 <- function(object) "unknown-md5-hash"
}
write_md5 <- function(object) { write_md5 <- function(object) {
conn <- file(paste0("data-raw/", deparse(substitute(object)), ".md5")) conn <- file(paste0("data-raw/", deparse(substitute(object)), ".md5"))
writeLines(digest::digest(object, "md5"), conn) writeLines(md5(object), conn)
close(conn) close(conn)
} }
changed_md5 <- function(object) { changed_md5 <- function(object) {
tryCatch({ tryCatch({
conn <- file(paste0("data-raw/", deparse(substitute(object)), ".md5")) conn <- file(paste0("data-raw/", deparse(substitute(object)), ".md5"))
compared <- digest::digest(object, "md5") != readLines(con = conn) compared <- md5(object) != readLines(con = conn)
close(conn) close(conn)
compared compared
}, error = function(e) TRUE) }, error = function(e) TRUE)
} }
# give official names to ABs and MOs # give official names to ABs and MOs
rsi <- AMR::rsi_translation %>% rsi <- rsi_translation %>%
mutate(mo_name = mo_name(mo, language = NULL), .after = mo) %>% mutate(mo_name = mo_name(mo, language = NULL), .after = mo) %>%
mutate(ab_name = ab_name(ab, language = NULL), .after = ab) mutate(ab_name = ab_name(ab, language = NULL), .after = ab)
if (changed_md5(rsi)) { if (changed_md5(rsi)) {
@ -259,18 +293,25 @@ if (changed_md5(rsi)) {
try(haven::write_sav(rsi, "data-raw/rsi_translation.sav"), silent = TRUE) try(haven::write_sav(rsi, "data-raw/rsi_translation.sav"), silent = TRUE)
try(haven::write_dta(rsi, "data-raw/rsi_translation.dta"), silent = TRUE) try(haven::write_dta(rsi, "data-raw/rsi_translation.dta"), silent = TRUE)
try(openxlsx::write.xlsx(rsi, "data-raw/rsi_translation.xlsx"), silent = TRUE) try(openxlsx::write.xlsx(rsi, "data-raw/rsi_translation.xlsx"), silent = TRUE)
try(arrow::write_feather(rsi, "data-raw/rsi_translation.feather"), silent = TRUE)
try(arrow::write_parquet(rsi, "data-raw/rsi_translation.parquet"), silent = TRUE)
} }
mo <- dplyr::mutate_if(microorganisms, ~!is.numeric(.), as.character) if (changed_md5(microorganisms)) {
if (changed_md5(mo)) {
usethis::ui_info(paste0("Saving {usethis::ui_value('microorganisms')} to {usethis::ui_value('/data-raw/')}")) usethis::ui_info(paste0("Saving {usethis::ui_value('microorganisms')} to {usethis::ui_value('/data-raw/')}"))
write_md5(mo) write_md5(microorganisms)
try(saveRDS(mo, "data-raw/microorganisms.rds", version = 2, compress = "xz"), silent = TRUE) try(saveRDS(microorganisms, "data-raw/microorganisms.rds", version = 2, compress = "xz"), silent = TRUE)
try(write.table(mo, "data-raw/microorganisms.txt", sep = "\t", na = "", row.names = FALSE), silent = TRUE) try(write.table(mo, "data-raw/microorganisms.txt", sep = "\t", na = "", row.names = FALSE), silent = TRUE)
try(haven::write_sas(dplyr::select(mo, -snomed), "data-raw/microorganisms.sas"), silent = TRUE) max_50_snomed <- sapply(microorganisms$snomed, function(x) paste(x[seq_len(min(50, length(x), na.rm = TRUE))], collapse = " "))
try(haven::write_sav(dplyr::select(mo, -snomed), "data-raw/microorganisms.sav"), silent = TRUE) mo <- microorganisms
try(haven::write_dta(dplyr::select(mo, -snomed), "data-raw/microorganisms.dta"), silent = TRUE) mo$snomed <- max_50_snomed
try(openxlsx::write.xlsx(dplyr::select(mo, -snomed), "data-raw/microorganisms.xlsx"), silent = TRUE) mo <- dplyr::mutate_if(mo, ~!is.numeric(.), as.character)
try(haven::write_sas(mo, "data-raw/microorganisms.sas"), silent = TRUE)
try(haven::write_sav(mo, "data-raw/microorganisms.sav"), silent = TRUE)
try(haven::write_dta(mo, "data-raw/microorganisms.dta"), silent = TRUE)
try(openxlsx::write.xlsx(mo, "data-raw/microorganisms.xlsx"), silent = TRUE)
try(arrow::write_feather(microorganisms, "data-raw/microorganisms.feather"), silent = TRUE)
try(arrow::write_parquet(microorganisms, "data-raw/microorganisms.parquet"), silent = TRUE)
} }
if (changed_md5(microorganisms.old)) { if (changed_md5(microorganisms.old)) {
@ -282,30 +323,36 @@ if (changed_md5(microorganisms.old)) {
try(haven::write_sav(microorganisms.old, "data-raw/microorganisms.old.sav"), silent = TRUE) try(haven::write_sav(microorganisms.old, "data-raw/microorganisms.old.sav"), silent = TRUE)
try(haven::write_dta(microorganisms.old, "data-raw/microorganisms.old.dta"), silent = TRUE) try(haven::write_dta(microorganisms.old, "data-raw/microorganisms.old.dta"), silent = TRUE)
try(openxlsx::write.xlsx(microorganisms.old, "data-raw/microorganisms.old.xlsx"), silent = TRUE) try(openxlsx::write.xlsx(microorganisms.old, "data-raw/microorganisms.old.xlsx"), silent = TRUE)
try(arrow::write_feather(microorganisms.old, "data-raw/microorganisms.old.feather"), silent = TRUE)
try(arrow::write_parquet(microorganisms.old, "data-raw/microorganisms.old.parquet"), silent = TRUE)
} }
ab <- dplyr::mutate_if(antibiotics, ~!is.numeric(.), as.character) ab <- dplyr::mutate_if(antibiotics, ~!is.numeric(.), as.character)
if (changed_md5(ab)) { if (changed_md5(ab)) {
usethis::ui_info(paste0("Saving {usethis::ui_value('antibiotics')} to {usethis::ui_value('/data-raw/')}")) usethis::ui_info(paste0("Saving {usethis::ui_value('antibiotics')} to {usethis::ui_value('/data-raw/')}"))
write_md5(ab) write_md5(ab)
try(saveRDS(ab, "data-raw/antibiotics.rds", version = 2, compress = "xz"), silent = TRUE) try(saveRDS(antibiotics, "data-raw/antibiotics.rds", version = 2, compress = "xz"), silent = TRUE)
try(write.table(ab, "data-raw/antibiotics.txt", sep = "\t", na = "", row.names = FALSE), silent = TRUE) try(write.table(antibiotics, "data-raw/antibiotics.txt", sep = "\t", na = "", row.names = FALSE), silent = TRUE)
try(haven::write_sas(ab, "data-raw/antibiotics.sas"), silent = TRUE) try(haven::write_sas(ab, "data-raw/antibiotics.sas"), silent = TRUE)
try(haven::write_sav(ab, "data-raw/antibiotics.sav"), silent = TRUE) try(haven::write_sav(ab, "data-raw/antibiotics.sav"), silent = TRUE)
try(haven::write_dta(ab, "data-raw/antibiotics.dta"), silent = TRUE) try(haven::write_dta(ab, "data-raw/antibiotics.dta"), silent = TRUE)
try(openxlsx::write.xlsx(ab, "data-raw/antibiotics.xlsx"), silent = TRUE) try(openxlsx::write.xlsx(ab, "data-raw/antibiotics.xlsx"), silent = TRUE)
try(arrow::write_feather(antibiotics, "data-raw/antibiotics.feather"), silent = TRUE)
try(arrow::write_parquet(antibiotics, "data-raw/antibiotics.parquet"), silent = TRUE)
} }
av <- dplyr::mutate_if(antivirals, ~!is.numeric(.), as.character) av <- dplyr::mutate_if(antivirals, ~!is.numeric(.), as.character)
if (changed_md5(av)) { if (changed_md5(av)) {
usethis::ui_info(paste0("Saving {usethis::ui_value('antivirals')} to {usethis::ui_value('/data-raw/')}")) usethis::ui_info(paste0("Saving {usethis::ui_value('antivirals')} to {usethis::ui_value('/data-raw/')}"))
write_md5(av) write_md5(av)
try(saveRDS(av, "data-raw/antivirals.rds", version = 2, compress = "xz"), silent = TRUE) try(saveRDS(antivirals, "data-raw/antivirals.rds", version = 2, compress = "xz"), silent = TRUE)
try(write.table(av, "data-raw/antivirals.txt", sep = "\t", na = "", row.names = FALSE), silent = TRUE) try(write.table(av, "data-raw/antivirals.txt", sep = "\t", na = "", row.names = FALSE), silent = TRUE)
try(haven::write_sas(av, "data-raw/antivirals.sas"), silent = TRUE) try(haven::write_sas(av, "data-raw/antivirals.sas"), silent = TRUE)
try(haven::write_sav(av, "data-raw/antivirals.sav"), silent = TRUE) try(haven::write_sav(av, "data-raw/antivirals.sav"), silent = TRUE)
try(haven::write_dta(av, "data-raw/antivirals.dta"), silent = TRUE) try(haven::write_dta(av, "data-raw/antivirals.dta"), silent = TRUE)
try(openxlsx::write.xlsx(av, "data-raw/antivirals.xlsx"), silent = TRUE) try(openxlsx::write.xlsx(av, "data-raw/antivirals.xlsx"), silent = TRUE)
try(arrow::write_feather(antivirals, "data-raw/antivirals.feather"), silent = TRUE)
try(arrow::write_parquet(antivirals, "data-raw/antivirals.parquet"), silent = TRUE)
} }
# give official names to ABs and MOs # give official names to ABs and MOs
@ -321,6 +368,8 @@ if (changed_md5(intrinsicR)) {
try(haven::write_sav(intrinsicR, "data-raw/intrinsic_resistant.sav"), silent = TRUE) try(haven::write_sav(intrinsicR, "data-raw/intrinsic_resistant.sav"), silent = TRUE)
try(haven::write_dta(intrinsicR, "data-raw/intrinsic_resistant.dta"), silent = TRUE) try(haven::write_dta(intrinsicR, "data-raw/intrinsic_resistant.dta"), silent = TRUE)
try(openxlsx::write.xlsx(intrinsicR, "data-raw/intrinsic_resistant.xlsx"), silent = TRUE) try(openxlsx::write.xlsx(intrinsicR, "data-raw/intrinsic_resistant.xlsx"), silent = TRUE)
try(arrow::write_feather(intrinsicR, "data-raw/intrinsic_resistant.feather"), silent = TRUE)
try(arrow::write_parquet(intrinsicR, "data-raw/intrinsic_resistant.parquet"), silent = TRUE)
} }
if (changed_md5(dosage)) { if (changed_md5(dosage)) {
@ -332,6 +381,8 @@ if (changed_md5(dosage)) {
try(haven::write_sav(dosage, "data-raw/dosage.sav"), silent = TRUE) try(haven::write_sav(dosage, "data-raw/dosage.sav"), silent = TRUE)
try(haven::write_dta(dosage, "data-raw/dosage.dta"), silent = TRUE) try(haven::write_dta(dosage, "data-raw/dosage.dta"), silent = TRUE)
try(openxlsx::write.xlsx(dosage, "data-raw/dosage.xlsx"), silent = TRUE) try(openxlsx::write.xlsx(dosage, "data-raw/dosage.xlsx"), silent = TRUE)
try(arrow::write_feather(dosage, "data-raw/dosage.feather"), silent = TRUE)
try(arrow::write_parquet(dosage, "data-raw/dosage.parquet"), silent = TRUE)
} }
reset_AMR_locale() reset_AMR_locale()
@ -340,3 +391,6 @@ reset_AMR_locale()
current_globalenv <- ls(envir = globalenv()) current_globalenv <- ls(envir = globalenv())
rm(list = current_globalenv[!current_globalenv %in% old_globalenv]) rm(list = current_globalenv[!current_globalenv %in% old_globalenv])
rm(current_globalenv) rm(current_globalenv)
devtools::load_all(quiet = TRUE)
devtools::document()

View File

@ -901,7 +901,7 @@ usethis::use_data(rsi_translation, overwrite = TRUE, version = 2)
usethis::use_data(microorganisms.codes, overwrite = TRUE, version = 2) usethis::use_data(microorganisms.codes, overwrite = TRUE, version = 2)
# saveRDS(microorganisms.translation, file = "data-raw/microorganisms.translation.rds", version = 2) # saveRDS(microorganisms.translation, file = "data-raw/microorganisms.translation.rds", version = 2)
# to save microorganisms.translation internally to the package # to save microorganisms.translation internally to the package
# source("data-raw/_internals.R") # source("data-raw/pre-commit-hook.R")
# load new data sets again # load new data sets again
devtools::load_all(".") devtools::load_all(".")

View File

@ -444,7 +444,7 @@ rm(intrinsic_resistant)
# load new data sets again # load new data sets again
devtools::load_all(".") devtools::load_all(".")
source("data-raw/_internals.R") source("data-raw/pre-commit-hook.R")
devtools::load_all(".") devtools::load_all(".")

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
vignettes/AMR_intro.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

View File

@ -13,7 +13,7 @@ editor_options:
chunk_output_type: console chunk_output_type: console
--- ---
```{r setup, include = FALSE, results = 'markup'} ```{r setup, include = FALSE, results = "markup"}
knitr::opts_chunk$set( knitr::opts_chunk$set(
warning = FALSE, warning = FALSE,
collapse = TRUE, collapse = TRUE,
@ -40,30 +40,41 @@ download_txt <- function(filename) {
". Find more info about the structure of this data set [here](https://msberends.github.io/AMR/reference/", ifelse(filename == "antivirals", "antibiotics", filename), ".html).\n") ". Find more info about the structure of this data set [here](https://msberends.github.io/AMR/reference/", ifelse(filename == "antivirals", "antibiotics", filename), ".html).\n")
github_base <- "https://github.com/msberends/AMR/raw/main/data-raw/" github_base <- "https://github.com/msberends/AMR/raw/main/data-raw/"
filename <- paste0("../data-raw/", filename) filename <- paste0("../data-raw/", filename)
txt <- paste0(filename, ".txt")
rds <- paste0(filename, ".rds") rds <- paste0(filename, ".rds")
txt <- paste0(filename, ".txt")
excel <- paste0(filename, ".xlsx")
feather <- paste0(filename, ".feather")
parquet <- paste0(filename, ".parquet")
sas <- paste0(filename, ".sas")
spss <- paste0(filename, ".sav") spss <- paste0(filename, ".sav")
stata <- paste0(filename, ".dta") stata <- paste0(filename, ".dta")
sas <- paste0(filename, ".sas") create_txt <- function(filename, type, software, exists) {
excel <- paste0(filename, ".xlsx") if (isTRUE(exists)) {
create_txt <- function(filename, type, software) { paste0("* Download as [", software, "](", github_base, filename, ") (",
paste0("* Download as [", software, " file](", github_base, filename, ") (", AMR:::formatted_filesize(filename), ") \n") AMR:::formatted_filesize(filename), ") \n")
} else {
paste0("* *(unavailable as ", software, ")*\n")
}
} }
if (any(file.exists(rds), if (any(file.exists(rds),
file.exists(excel),
file.exists(txt), file.exists(txt),
file.exists(excel),
file.exists(feather),
file.exists(parquet),
file.exists(sas), file.exists(sas),
file.exists(spss), file.exists(spss),
file.exists(stata))) { file.exists(stata))) {
msg <- c(msg, "\n**Direct download links:**\n\n") msg <- c(msg, "\n**Direct download links:**\n\n",
create_txt(rds, "rds", "original R Data Structure (RDS) file", file.exists(rds)),
create_txt(txt, "txt", "tab-separated text file", file.exists(txt)),
create_txt(excel, "xlsx", "Microsoft Excel workbook", file.exists(excel)),
create_txt(feather, "feather", "Apache Feather file", file.exists(feather)),
create_txt(parquet, "parquet", "Apache Parquet file", file.exists(parquet)),
create_txt(sas, "sas", "SAS data file", file.exists(sas)),
create_txt(spss, "sav", "IBM SPSS Statistics data file", file.exists(spss)),
create_txt(stata, "dta", "Stata DTA file", file.exists(stata)))
} }
if (file.exists(rds)) msg <- c(msg, create_txt(rds, "rds", "R"))
if (file.exists(excel)) msg <- c(msg, create_txt(excel, "xlsx", "Excel"))
if (file.exists(txt)) msg <- c(msg, create_txt(txt, "txt", "plain text"))
if (file.exists(sas)) msg <- c(msg, create_txt(sas, "sas", "SAS"))
if (file.exists(spss)) msg <- c(msg, create_txt(spss, "sav", "SPSS"))
if (file.exists(stata)) msg <- c(msg, create_txt(stata, "dta", "Stata"))
paste0(msg, collapse = "") paste0(msg, collapse = "")
} }
@ -87,14 +98,13 @@ print_df <- function(x, rows = 6) {
}) %>% }) %>%
knitr::kable(align = "c") knitr::kable(align = "c")
} }
``` ```
All reference data (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this `AMR` package are reliable, up-to-date and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply tab separated files that are machine-readable and suitable for input in any software program, such as laboratory information systems. All reference data (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this `AMR` package are reliable, up-to-date and freely available. We continually export our data sets to formats for use in R, MS Excel, Apache Feather, Apache Parquet, SPSS, SAS, and Stata. We also provide tab-separated text files that are machine-readable and suitable for input in any software program, such as laboratory information systems.
On this page, we explain how to download them and how the structure of the data sets look like. On this page, we explain how to download them and how the structure of the data sets look like.
## Microorganisms (currently accepted names) ## `microorganisms`: Microbial Taxonomy (currently accepted names)
`r structure_txt(microorganisms)` `r structure_txt(microorganisms)`
@ -102,6 +112,8 @@ This data set is in R available as `microorganisms`, after you load the `AMR` pa
`r download_txt("microorganisms")` `r download_txt("microorganisms")`
**NOTE: The exported files for Excel, SAS, SPSS and Stata contain only the first 50 SNOMED codes per record, as their file size would otherwise exceed 100 MB; the file size limit of GitHub.** Advice? Use R instead.
### Source ### Source
Our full taxonomy of microorganisms is based on the authoritative and comprehensive: Our full taxonomy of microorganisms is based on the authoritative and comprehensive:
@ -130,7 +142,7 @@ microorganisms %>%
print_df() print_df()
``` ```
## Microorganisms (previously accepted names) ## `microorganisms.old`: Microbial Taxonomy (previously accepted names)
`r structure_txt(microorganisms.old)` `r structure_txt(microorganisms.old)`
@ -158,7 +170,7 @@ microorganisms.old %>%
``` ```
## Antibiotic agents ## `antibiotics`: Antibiotic Agents
`r structure_txt(antibiotics)` `r structure_txt(antibiotics)`
@ -183,7 +195,7 @@ antibiotics %>%
``` ```
## Antiviral agents ## `antivirals`: Antiviral Agents
`r structure_txt(antivirals)` `r structure_txt(antivirals)`
@ -205,7 +217,7 @@ antivirals %>%
print_df() print_df()
``` ```
## Interpretation from MIC values / disk diameters to R/SI ## `rsi_translation`: Interpretation from MIC values / disk diameters to R/SI
`r structure_txt(rsi_translation)` `r structure_txt(rsi_translation)`
@ -227,7 +239,7 @@ rsi_translation %>%
``` ```
## Intrinsic bacterial resistance ## `intrinsic_resistant`: Intrinsic Bacterial Resistance
`r structure_txt(intrinsic_resistant)` `r structure_txt(intrinsic_resistant)`
@ -253,7 +265,7 @@ intrinsic_resistant %>%
``` ```
## Dosage guidelines from EUCAST ## `dosage`: Dosage Guidelines from EUCAST
`r structure_txt(dosage)` `r structure_txt(dosage)`

View File

@ -22,15 +22,19 @@ knitr::opts_chunk$set(
) )
``` ```
Note: to keep the package size as small as possible, we only included this vignette on CRAN. You can read more vignettes on our website about how to conduct AMR data analysis, determine MDRO's, find explanation of EUCAST rules, and much more: <https://msberends.github.io/AMR/articles/>. Note: to keep the package size as small as possible, we only included this vignette on CRAN. You can read more vignettes on our website about how to conduct AMR data analysis, determine MDROs, find explanation of EUCAST rules, and much more: <https://msberends.github.io/AMR/articles/>.
---- ----
`AMR` is a free, open-source and independent R package (see [Copyright](https://msberends.github.io/AMR/#copyright)) to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial data and properties, by using evidence-based methods. **Our aim is to provide a standard** for clean and reproducible antimicrobial resistance data analysis, that can therefore empower epidemiological analyses to continuously enable surveillance and treatment evaluation in any setting. The `AMR` package is a [free and open-source](https://msberends.github.io/AMR/#copyright) R package with [zero dependencies](https://en.wikipedia.org/wiki/Dependency_hell) to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial data and properties, by using evidence-based methods. **Our aim is to provide a standard** for clean and reproducible AMR data analysis, that can therefore empower epidemiological analyses to continuously enable surveillance and treatment evaluation in any setting.
```{r, echo = FALSE, out.width = "555px"}
knitr::include_graphics("AMR_intro.png")
```
After installing this package, R knows `r AMR:::format_included_data_number(AMR::microorganisms)` distinct microbial species and all `r AMR:::format_included_data_number(rbind(AMR::antibiotics[, "atc", drop = FALSE], AMR::antivirals[, "atc", drop = FALSE]))` antibiotic, antimycotic and antiviral drugs by name and code (including ATC, EARS-Net, PubChem, LOINC and SNOMED CT), and knows all about valid R/SI and MIC values. It supports any data format, including WHONET/EARS-Net data. After installing this package, R knows `r AMR:::format_included_data_number(AMR::microorganisms)` distinct microbial species and all `r AMR:::format_included_data_number(rbind(AMR::antibiotics[, "atc", drop = FALSE], AMR::antivirals[, "atc", drop = FALSE]))` antibiotic, antimycotic and antiviral drugs by name and code (including ATC, EARS-Net, PubChem, LOINC and SNOMED CT), and knows all about valid R/SI and MIC values. It supports any data format, including WHONET/EARS-Net data.
The `AMR` package is available in Danish, Dutch, English, French, German, Italian, Portuguese, Russian, Spanish and Swedish. Antimicrobial drug (group) names and colloquial microorganism names are provided in these languages. The `AMR` package is available in English, Chinese, Danish, Dutch, French, German, Greek, Italian, Japanese, Polish, Portuguese, Russian, Spanish, Swedish, Turkish and Ukrainian. Antimicrobial drug (group) names and colloquial microorganism names are provided in these languages.
This package is fully independent of any other R package and works on Windows, macOS and Linux with all versions of R since R-3.0 (April 2013). **It was designed to work in any setting, including those with very limited resources**. Since its first public release in early 2018, this package has been downloaded from more than 175 countries. This package is fully independent of any other R package and works on Windows, macOS and Linux with all versions of R since R-3.0 (April 2013). **It was designed to work in any setting, including those with very limited resources**. Since its first public release in early 2018, this package has been downloaded from more than 175 countries.
@ -56,3 +60,9 @@ This package can be used for:
All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this `AMR` package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find [all download links on our website](https://msberends.github.io/AMR/articles/datasets.html), which is automatically updated with every code change. All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this `AMR` package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find [all download links on our website](https://msberends.github.io/AMR/articles/datasets.html), which is automatically updated with every code change.
This R package was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the [University of Groningen](https://www.rug.nl), in collaboration with non-profit organisations [Certe Medical Diagnostics and Advice Foundation](https://www.certe.nl) and [University Medical Center Groningen](https://www.umcg.nl). This R package formed the basis of two PhD theses ([DOI 10.33612/diss.177417131](https://doi.org/10.33612/diss.177417131) and [DOI 10.33612/diss.192486375](https://doi.org/10.33612/diss.192486375)) but is actively and durably maintained (see [changelog)](https://msberends.github.io/AMR/news/index.html)) by two public healthcare organisations in the Netherlands. This R package was created for both routine data analysis and academic research at the Faculty of Medical Sciences of the [University of Groningen](https://www.rug.nl), in collaboration with non-profit organisations [Certe Medical Diagnostics and Advice Foundation](https://www.certe.nl) and [University Medical Center Groningen](https://www.umcg.nl). This R package formed the basis of two PhD theses ([DOI 10.33612/diss.177417131](https://doi.org/10.33612/diss.177417131) and [DOI 10.33612/diss.192486375](https://doi.org/10.33612/diss.192486375)) but is actively and durably maintained (see [changelog)](https://msberends.github.io/AMR/news/index.html)) by two public healthcare organisations in the Netherlands.
----
<small>
This AMR package for R is free, open-source software and licensed under the [GNU General Public License v2.0 (GPL-2)](https://msberends.github.io/AMR/LICENSE-text.html). These requirements are consequently legally binding: modifications must be released under the same license when distributing the package, changes made to the code must be documented, source code must be made available when the package is distributed, and a copy of the license and copyright notice must be included with the package.
</small>