Browse Source

(v1.2.0.9026) move to github

main
parent
commit
76fc8e1b14
  1. 1
      .Rbuildignore
  2. 124
      .github/workflows/R-CMD-check.yaml
  3. 68
      .github/workflows/codecovr.yaml
  4. 66
      .github/workflows/lintr.yaml
  5. 54
      .gitlab-ci.R
  6. 190
      .gitlab-ci.yml
  7. 10
      DESCRIPTION
  8. 6
      NEWS.md
  9. 22
      R/aa_helper_functions.R
  10. 4
      R/aa_helper_functions_dplyr.R
  11. 4
      R/ab.R
  12. 4
      R/ab_class_selectors.R
  13. 4
      R/ab_from_text.R
  14. 4
      R/ab_property.R
  15. 4
      R/age.R
  16. 8
      R/amr.R
  17. 4
      R/atc_online.R
  18. 4
      R/availability.R
  19. 4
      R/bug_drug_combinations.R
  20. 6
      R/catalogue_of_life.R
  21. 4
      R/count.R
  22. 20
      R/data.R
  23. 4
      R/deprecated.R
  24. 4
      R/disk.R
  25. 6
      R/eucast_rules.R
  26. 4
      R/filter_ab_class.R
  27. 4
      R/first_isolate.R
  28. 4
      R/g.test.R
  29. 4
      R/ggplot_pca.R
  30. 12
      R/ggplot_rsi.R
  31. 4
      R/globals.R
  32. 4
      R/guess_ab_col.R
  33. 4
      R/join_microorganisms.R
  34. 4
      R/key_antibiotics.R
  35. 4
      R/kurtosis.R
  36. 6
      R/lifecycle.R
  37. 4
      R/like.R
  38. 6
      R/mdro.R
  39. 4
      R/mic.R
  40. 4
      R/mo.R
  41. 4
      R/mo_property.R
  42. 4
      R/mo_source.R
  43. 4
      R/p_symbol.R
  44. 4
      R/pca.R
  45. 4
      R/proportion.R
  46. 4
      R/resistance_predict.R
  47. 6
      R/rsi.R
  48. 4
      R/rsi_calc.R
  49. 4
      R/rsi_df.R
  50. 4
      R/skewness.R
  51. 16
      R/translate.R
  52. 4
      R/whocc.R
  53. 4
      R/zzz.R
  54. 6
      README.md
  55. 10
      _pkgdown.yml
  56. 81
      appveyor.yml
  57. 4
      codecov.yml
  58. 2
      cran-comments.md
  59. BIN
      data-raw/github_preview.png
  60. BIN
      data-raw/github_preview.psd
  61. 42
      data-raw/microorganisms.txt
  62. 12
      data-raw/reproduction_of_microorganisms.R
  63. BIN
      data/microorganisms.rda
  64. 34
      docs/404.html
  65. 8
      docs/LICENSE-text.html
  66. 8
      docs/articles/index.html
  67. 10
      docs/authors.html
  68. 4
      docs/extra.css
  69. 5
      docs/extra.js
  70. 16
      docs/index.html
  71. 22
      docs/news/index.html
  72. 6
      docs/pkgdown.yml
  73. 12
      docs/reference/AMR-deprecated.html
  74. 14
      docs/reference/AMR.html
  75. 12
      docs/reference/WHOCC.html
  76. 12
      docs/reference/WHONET.html
  77. 14
      docs/reference/ab_from_text.html
  78. 12
      docs/reference/ab_property.html
  79. 12
      docs/reference/age.html
  80. 12
      docs/reference/age_groups.html
  81. 20
      docs/reference/antibiotics.html
  82. 14
      docs/reference/as.ab.html
  83. 12
      docs/reference/as.disk.html
  84. 12
      docs/reference/as.mic.html
  85. 12
      docs/reference/as.mo.html
  86. 14
      docs/reference/as.rsi.html
  87. 12
      docs/reference/atc_online.html
  88. 12
      docs/reference/availability.html
  89. 12
      docs/reference/bug_drug_combinations.html
  90. 14
      docs/reference/catalogue_of_life.html
  91. 12
      docs/reference/catalogue_of_life_version.html
  92. 12
      docs/reference/count.html
  93. 16
      docs/reference/eucast_rules.html
  94. 14
      docs/reference/example_isolates.html
  95. 12
      docs/reference/example_isolates_unclean.html
  96. 10
      docs/reference/filter_ab_class.html
  97. 12
      docs/reference/first_isolate.html
  98. 12
      docs/reference/g.test.html
  99. 12
      docs/reference/ggplot_pca.html
  100. 24
      docs/reference/ggplot_rsi.html
  101. Some files were not shown because too many files have changed in this diff Show More

1
.Rbuildignore

@ -12,6 +12,7 @@ @@ -12,6 +12,7 @@
^codecov\.yml$
^cran-comments\.md$
^CRAN-RELEASE$
^\.github$
^doc$
^docs$
^git_.*\.sh$

124
.github/workflows/R-CMD-check.yaml

@ -0,0 +1,124 @@ @@ -0,0 +1,124 @@
# ==================================================================== #
# TITLE #
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
# #
# 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 more info: https://msberends.github.io/AMR. #
# ==================================================================== #
on:
push:
branches:
- premaster
- master
pull_request:
branches:
- master
name: R-CMD-check
jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-16.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: windows-latest, r: 'oldrel'}
- {os: macOS-latest, r: 'oldrel'}
- {os: ubuntu-16.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
- {os: windows-latest, r: 'devel'}
- {os: macOS-latest, r: 'devel'}
- {os: ubuntu-16.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
# - {os: windows-latest, r: '3.6'}
# - {os: ubuntu-16.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
# - {os: ubuntu-16.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
# - {os: ubuntu-16.04, r: '3.3', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@master
with:
r-version: ${{ matrix.config.r }}
- uses: r-lib/actions/setup-pandoc@master
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
- name: Install system dependencies
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}
- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}
- name: Check
env:
_R_CHECK_CRAN_INCOMING_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}
- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
- name: Upload check results
if: failure()
uses: actions/upload-artifact@master
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check

68
.github/workflows/codecovr.yaml

@ -0,0 +1,68 @@ @@ -0,0 +1,68 @@
# ==================================================================== #
# TITLE #
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
# #
# 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 more info: https://msberends.github.io/AMR. #
# ==================================================================== #
on:
push:
branches:
- premaster
- master
pull_request:
branches:
- master
name: test-coverage
jobs:
test-coverage:
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@master
- uses: r-lib/actions/setup-pandoc@master
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
- name: Cache R packages
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
- name: Install dependencies
run: |
install.packages(c("remotes"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("covr")
shell: Rscript {0}
- name: Test coverage
run: covr::codecov()
shell: Rscript {0}

66
.github/workflows/lintr.yaml

@ -0,0 +1,66 @@ @@ -0,0 +1,66 @@
# ==================================================================== #
# TITLE #
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
# #
# 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 more info: https://msberends.github.io/AMR. #
# ==================================================================== #
on:
push:
branches:
- premaster
- master
pull_request:
branches:
- master
name: lint
jobs:
lint:
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@master
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
- name: Cache R packages
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
- name: Install dependencies
run: |
install.packages(c("remotes"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("lintr")
shell: Rscript {0}
- name: Lint
run: lintr::lint_package()
shell: Rscript {0}

54
.gitlab-ci.R

@ -1,54 +0,0 @@ @@ -1,54 +0,0 @@
# ==================================================================== #
# TITLE #
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
# #
# 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 more info: https://msberends.gitlab.io/AMR. #
# ==================================================================== #
install_if_needed <- function(pkg, repos, quiet) {
package_path <- find.package(pkg, quiet = quiet)
if (length(package_path) == 0) {
message("NOTE: pkg ", pkg, " missing, installing...")
install.packages(pkg, repos = repos, quiet = quiet)
}
}
gl_update_pkg_all <- function(repos = "https://cran.rstudio.com",
quiet = TRUE,
install_pkgdown = FALSE,
install_lintr = FALSE) {
# update existing
update.packages(ask = FALSE, repos = repos, quiet = quiet)
install_if_needed(pkg = "devtools", repos = repos, quiet = quiet)
if (install_pkgdown == TRUE) {
install_if_needed(pkg = "pkgdown", repos = repos, quiet = quiet)
}
if (install_lintr == TRUE) {
install_if_needed(pkg = "lintr", repos = repos, quiet = quiet)
}
install_if_needed(pkg = "cleaner", repos = repos, quiet = quiet)
devtools::install_dev_deps(repos = repos, quiet = quiet, upgrade = TRUE)
cat("INSTALLED:\n")
instld <- as.data.frame(installed.packages())
rownames(instld) <- NULL
print(instld[, c("Package", "Version")])
return(invisible(TRUE))
}

190
.gitlab-ci.yml

@ -1,190 +0,0 @@ @@ -1,190 +0,0 @@
# ==================================================================== #
# TITLE #
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
# #
# 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 more info: https://msberends.gitlab.io/AMR. #
# ==================================================================== #
# to do a full CRAN check with R-Hub:
# chck <- rhub::check(devtools::build(), platform = rhub::platforms()[!is.na(rhub::platforms()$`cran-name`), 'name'])
stages:
- test
- check
- lint
- website
- coverage
image: rocker/r-base
before_script:
- apt-get update -qq --allow-releaseinfo-change
# install dependencies for packages
- apt-get install -y wget locales libxml2-dev libssl-dev libcurl4-openssl-dev zlib1g-dev > /dev/null
# recent pandoc
- wget --quiet https://github.com/jgm/pandoc/releases/download/2.9.2.1/pandoc-2.9.2.1-1-amd64.deb
- dpkg -i pandoc*.deb
- rm pandoc*.deb
# set R system language
- echo "LC_ALL=en_US.UTF-8" >> /etc/environment
- echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
- echo "LANG=en_US.UTF-8" > /etc/locale.conf
- locale-gen
# cache R packages
- mkdir -p installed_deps
- echo 'R_LIBS="installed_deps"' > .Renviron
- echo 'R_LIBS_USER="installed_deps"' >> .Renviron
- echo 'R_LIBS_SITE="installed_deps"' >> .Renviron
# set language
- echo 'LANGUAGE="en_US.utf8"' >> .Renviron
- echo 'LANG="en_US.utf8"' >> .Renviron
- echo 'LANGUAGE="en_US.utf8"' > ~/.Renviron
# ---- TEST
R-release_test:
stage: test
when: always
allow_failure: false
script:
- Rscript -e 'sessionInfo()'
# install missing and outdated packages
- Rscript -e 'source(".gitlab-ci.R"); gl_update_pkg_all(repos = "https://cran.rstudio.com", quiet = TRUE, install_pkgdown = TRUE, install_lintr = TRUE)'
- Rscript -e 'devtools::test(stop_on_failure = FALSE)'
cache:
key: release
paths:
- installed_deps/
R-devel_test:
stage: test
when: always
image: rocker/r-devel
allow_failure: false
script:
- Rscriptdevel -e 'sessionInfo()'
# install missing and outdated packages
- Rscriptdevel -e 'source(".gitlab-ci.R"); gl_update_pkg_all(repos = "https://cran.rstudio.com", quiet = TRUE, install_pkgdown = TRUE, install_lintr = TRUE)'
- Rscriptdevel -e 'devtools::test(stop_on_failure = FALSE)'
cache:
key: devel
paths:
- installed_deps/
# ---- CHECK
R-release:
stage: check
when: on_success
allow_failure: true
script:
- Rscript -e 'sessionInfo()'
# install missing and outdated packages
- Rscript -e 'source(".gitlab-ci.R"); gl_update_pkg_all(repos = "https://cran.rstudio.com", quiet = TRUE, install_pkgdown = TRUE, install_lintr = TRUE)'
# remove vignettes folder and get VignetteBuilder field out of DESCRIPTION file
- rm -rf vignettes
- Rscript -e 'd <- read.dcf("DESCRIPTION"); d[, colnames(d) == "VignetteBuilder"] <- NA; write.dcf(d, "DESCRIPTION")'
# build package
- R CMD build . --no-build-vignettes --no-manual
- PKG_FILE_NAME=$(ls -1t *.tar.gz | head -n 1)
- Rscript -e 'Sys.setenv(NOT_CRAN = "true")'
- R CMD check "${PKG_FILE_NAME}" --no-build-vignettes --no-manual --as-cran
artifacts:
when: always
paths:
- '*.Rcheck/*'
expire_in: '1 month'
cache:
key: release
paths:
- installed_deps/
R-devel:
stage: check
when: on_success
image: rocker/r-devel
allow_failure: true
script:
- Rscriptdevel -e 'sessionInfo()'
# install missing and outdated packages
- Rscriptdevel -e 'source(".gitlab-ci.R"); gl_update_pkg_all(repos = "https://cran.rstudio.com", quiet = TRUE)'
# remove vignettes folder and get VignetteBuilder field out of DESCRIPTION file
- rm -rf vignettes
- Rscriptdevel -e 'd <- read.dcf("DESCRIPTION"); d[, colnames(d) == "VignetteBuilder"] <- NA; write.dcf(d, "DESCRIPTION")'
# build package
- Rdevel CMD build . --no-build-vignettes --no-manual
- PKG_FILE_NAME=$(ls -1t *.tar.gz | head -n 1)
- Rscript -e 'Sys.setenv(NOT_CRAN = "true")'
- Rdevel CMD check "${PKG_FILE_NAME}" --no-build-vignettes --no-manual --as-cran
artifacts:
when: always
paths:
- '*.Rcheck/*'
expire_in: '1 month'
cache:
key: devel
paths:
- installed_deps/
# ---- OTHER
lintr:
stage: lint
allow_failure: true
when: always
only:
- premaster
- master
script:
# check all syntax with lintr
- Rscript -e 'lintr::lint_package(exclusions = list("R/aa_helper_functions_dplyr.R"))'
cache:
key: release
paths:
- installed_deps/
policy: pull # no uploading after run
pages:
stage: website
allow_failure: true
when: always
only:
- master
script:
- mv docs public
artifacts:
paths:
- public
codecovr:
stage: coverage
allow_failure: true
when: always
only:
- premaster
- master
script:
- apt-get install --yes git
# codecov token is set in https://gitlab.com/msberends/AMR/settings/ci_cd
# Sys.setenv(NOT_CRAN = 'true'), because otherwise skip_on_cran() will be applied on Covr too, resulting in extremely low coverage percentages
- Rscript -e "Sys.setenv(NOT_CRAN = 'true'); cc <- covr::package_coverage(line_exclusions = list('R/atc_online.R', 'R/mo_history.R', 'R/mo_source.R', 'R/resistance_predict.R')); covr::codecov(coverage = cc, token = '$codecov'); cat('Code coverage:', covr::percent_coverage(cc))"
coverage: '/Code coverage: \d+\.\d+/'
cache:
key: release
paths:
- installed_deps/
policy: pull # no uploading after run

10
DESCRIPTION

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
Package: AMR
Version: 1.2.0.9025
Date: 2020-07-03
Version: 1.2.0.9026
Date: 2020-07-08
Title: Antimicrobial Resistance Analysis
Authors@R: c(
person(role = c("aut", "cre"),
@ -47,10 +47,10 @@ Suggests: @@ -47,10 +47,10 @@ Suggests:
tidyr,
utils
VignetteBuilder: knitr,rmarkdown
URL: https://msberends.gitlab.io/AMR, https://gitlab.com/msberends/AMR
BugReports: https://gitlab.com/msberends/AMR/issues
URL: https://msberends.github.io/AMR, https://github.com/msberends/AMR
BugReports: https://github.com/msberends/AMR/issues
License: GPL-2 | file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.0
RoxygenNote: 7.1.1
Roxygen: list(markdown = TRUE)

6
NEWS.md

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
# AMR 1.2.0.9025
## <small>Last updated: 03-Jul-2020</small>
# AMR 1.2.0.9026
## <small>Last updated: 08-Jul-2020</small>
### New
* Function `ab_from_text()` to retrieve antimicrobial drug names, doses and forms of administration from clinical texts in e.g. health care records, which also corrects for misspelling since it uses `as.ab()` internally
@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
* Improvements for `susceptibility()` and `resistance()` and all `count_*()`, `proportion_*()` functions:
* 95% speed improvement (!) by using other base R functions for calculation
* Using unexisting columns wil now return an error instead of dropping them silently
* Using variables for column names (as well as `dplyr::all_of()`) now works again
* Using variables for column names (as well as selectors like `dplyr::all_of()`) now works again
* Improvements for `as.ab()`:
* Dramatic improvement of the algorithm behind `as.ab()`, making many more input errors translatable, such as digitalised health care records, using too few or too many vowels or consonants and many more
* Added progress bar

22
R/aa_helper_functions.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
# functions from dplyr, will perhaps become poorman
@ -77,18 +77,22 @@ check_dataset_integrity <- function() { @@ -77,18 +77,22 @@ check_dataset_integrity <- function() {
"class", "order", "family", "genus",
"species", "subspecies", "rank",
"species_id", "source", "ref", "prevalence") %in% colnames(microorganisms),
na.rm = TRUE) & NROW(microorganisms) == NROW(MO_lookup)
na.rm = TRUE)
check_antibiotics <- all(c("ab", "atc", "cid", "name", "group",
"atc_group1", "atc_group2", "abbreviations",
"synonyms", "oral_ddd", "oral_units",
"iv_ddd", "iv_units", "loinc") %in% colnames(antibiotics),
na.rm = TRUE)
}, error = function(e)
stop('Please use the command \'library("AMR")\' before using this function, to load the required reference data.', call. = FALSE)
stop_('please use the command \'library("AMR")\' before using this function, to load the required reference data.', call = FALSE)
)
if (!check_microorganisms | !check_antibiotics) {
stop("Data set `microorganisms` or data set `antibiotics` is overwritten by your global environment and prevents the AMR package from working correctly. Please rename your object before using this function.", call. = FALSE)
}
data_in_pkg <- data(package = "AMR", envir = asNamespace("AMR"))$results[, "Item"]
data_in_globalenv <- ls(envir = globalenv())
overwritten <- data_in_pkg[data_in_pkg %in% data_in_globalenv]
stop_if(length(overwritten) > 0,
"the following data set is overwritten by your global environment and prevents the AMR package from working correctly:\n",
paste0("'", overwritten, "'", collapse = ", "),
".\nPlease rename your object before using this function.", call = FALSE)
invisible(TRUE)
}
@ -198,7 +202,9 @@ stop_ifnot_installed <- function(package) { @@ -198,7 +202,9 @@ stop_ifnot_installed <- function(package) {
import_fn <- function(name, pkg) {
stop_ifnot_installed(pkg)
get(name, envir = asNamespace(pkg))
tryCatch(
get(name, envir = asNamespace(pkg)),
error = function(e) stop_("an error occurred in import_fn() while using this function", call = FALSE))
}
stop_ <- function(..., call = TRUE) {

4
R/aa_helper_functions_dplyr.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
# ------------------------------------------------

4
R/ab.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' Transform to antibiotic ID

4
R/ab_class_selectors.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' Antibiotic class selectors

4
R/ab_from_text.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' Retrieve antimicrobial drug names and doses from clinical text

4
R/ab_property.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' Property of an antibiotic

4
R/age.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' Age in years of individuals

8
R/amr.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' The `AMR` Package
@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
#' - Principal component analysis for AMR
#' @section Read more on our website!:
#' On our website <https://msberends.gitlab.io/AMR> you can find [a comprehensive tutorial](https://msberends.gitlab.io/AMR/articles/AMR.html) about how to conduct AMR analysis, the [complete documentation of all functions](https://msberends.gitlab.io/AMR/reference) (which reads a lot easier than here in R) and [an example analysis using WHONET data](https://msberends.gitlab.io/AMR/articles/WHONET.html).
#' On our website <https://msberends.github.io/AMR> you can find [a comprehensive tutorial](https://msberends.github.io/AMR/articles/AMR.html) about how to conduct AMR analysis, the [complete documentation of all functions](https://msberends.github.io/AMR/reference) (which reads a lot easier than here in R) and [an example analysis using WHONET data](https://msberends.github.io/AMR/articles/WHONET.html).
#' @section Contact Us:
#' For suggestions, comments or questions, please contact us at:
#'
@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
#' The Netherlands
#'
#' If you have found a bug, please file a new issue at: \cr
#' <https://gitlab.com/msberends/AMR/issues>
#' <https://github.com/msberends/AMR/issues>
#' @name AMR
#' @rdname AMR
NULL

4
R/atc_online.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' Get ATC properties from WHOCC website

4
R/availability.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' Check availability of columns

4
R/bug_drug_combinations.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' Determine bug-drug combinations

6
R/catalogue_of_life.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' The Catalogue of Life
@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
#'
#' The Catalogue of Life (<http://www.catalogueoflife.org>) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.9 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation.
#'
#' The syntax used to transform the original data to a cleansed R format, can be found here: <https://gitlab.com/msberends/AMR/blob/master/data-raw/reproduction_of_microorganisms.R>.
#' The syntax used to transform the original data to a cleansed R format, can be found here: <https://github.com/msberends/AMR/blob/master/data-raw/reproduction_of_microorganisms.R>.
#' @inheritSection AMR Read more on our website!
#' @name catalogue_of_life
#' @rdname catalogue_of_life

4
R/count.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' Count available isolates

20
R/data.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' Data sets with `r format(nrow(antibiotics) + nrow(antivirals), big.mark = ",")` antimicrobials
@ -56,13 +56,13 @@ @@ -56,13 +56,13 @@
#' ### Direct download
#' These data sets are available as 'flat files' for use even without R - you can find the files here:
#'
#' * <https://gitlab.com/msberends/AMR/raw/master/data-raw/antibiotics.txt>
#' * <https://gitlab.com/msberends/AMR/raw/master/data-raw/antivirals.txt>
#' * <https://github.com/msberends/AMR/raw/master/data-raw/antibiotics.txt>
#' * <https://github.com/msberends/AMR/raw/master/data-raw/antivirals.txt>
#'
#' Files in R format (with preserved data structure) can be found here:
#'
#' * <https://gitlab.com/msberends/AMR/raw/master/data/antibiotics.rda>
#' * <https://gitlab.com/msberends/AMR/raw/master/data/antivirals.rda>
#' * <https://github.com/msberends/AMR/raw/master/data/antibiotics.rda>
#' * <https://github.com/msberends/AMR/raw/master/data/antivirals.rda>
#' @source World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology (WHOCC): <https://www.whocc.no/atc_ddd_index/>
#'
#' WHONET 2019 software: <http://www.whonet.org/software.html>
@ -102,11 +102,11 @@ @@ -102,11 +102,11 @@
#' ### Direct download
#' This data set is available as 'flat file' for use even without R - you can find the file here:
#'
#' * <https://gitlab.com/msberends/AMR/raw/master/data-raw/microorganisms.txt>
#' * <https://github.com/msberends/AMR/raw/master/data-raw/microorganisms.txt>
#'
#' The file in R format (with preserved data structure) can be found here:
#'
#' * <https://gitlab.com/msberends/AMR/raw/master/data/microorganisms.rda>
#' * <https://github.com/msberends/AMR/raw/master/data/microorganisms.rda>
#' @section About the records from DSMZ (see source):
#' Names of prokaryotes are defined as being validly published by the International Code of Nomenclature of Bacteria. Validly published are all names which are included in the Approved Lists of Bacterial Names and the names subsequently published in the International Journal of Systematic Bacteriology (IJSB) and, from January 2000, in the International Journal of Systematic and Evolutionary Microbiology (IJSEM) as original articles or in the validation lists.
#'
@ -157,7 +157,7 @@ catalogue_of_life <- list( @@ -157,7 +157,7 @@ catalogue_of_life <- list(
#' Data set with `r format(nrow(example_isolates), big.mark = ",")` example isolates
#'
#' A data set containing `r format(nrow(example_isolates), big.mark = ",")` microbial isolates with their full antibiograms. The data set reflects reality and can be used to practice AMR analysis. For examples, please read [the tutorial on our website](https://msberends.gitlab.io/AMR/articles/AMR.html).
#' A data set containing `r format(nrow(example_isolates), big.mark = ",")` microbial isolates with their full antibiograms. The data set reflects reality and can be used to practice AMR analysis. For examples, please read [the tutorial on our website](https://msberends.github.io/AMR/articles/AMR.html).
#' @format A [`data.frame`] with `r format(nrow(example_isolates), big.mark = ",")` observations and `r ncol(example_isolates)` variables:
#' - `date`\cr date of receipt at the laboratory
#' - `hospital_id`\cr ID of the hospital, from A to D
@ -231,6 +231,6 @@ catalogue_of_life <- list( @@ -231,6 +231,6 @@ catalogue_of_life <- list(
#' - `breakpoint_S`\cr Lowest MIC value or highest number of millimetres that leads to "S"
#' - `breakpoint_R`\cr Highest MIC value or lowest number of millimetres that leads to "R"
#' - `uti`\cr A logical value (`TRUE`/`FALSE`) to indicate whether the rule applies to a urinary tract infection (UTI)
#' @details The repository of this `AMR` package contains a file comprising this exact data set: <https://gitlab.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt>. This file **allows for machine reading EUCAST and CLSI guidelines**, which is almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. This file is updated automatically.
#' @details The repository of this `AMR` package contains a file comprising this exact data set: <https://github.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt>. This file **allows for machine reading EUCAST and CLSI guidelines**, which is almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. This file is updated automatically.
#' @inheritSection AMR Read more on our website!
"rsi_translation"

4
R/deprecated.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' Deprecated functions

4
R/disk.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' Class 'disk'

6
R/eucast_rules.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
# global variables
@ -52,7 +52,7 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016" @@ -52,7 +52,7 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016"
#'
#' These rules are not applied at default, since they are not approved by EUCAST. To use these rules, please use `eucast_rules(..., rules = "all")`, or set the default behaviour of the `[eucast_rules()]` function with `options(AMR.eucast_rules = "all")` (or any other valid input value(s) to the `rules` parameter).
#'
#' The file containing all EUCAST rules is located here: <https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv>.
#' The file containing all EUCAST rules is located here: <https://github.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv>.
#'
#' @section Antibiotics:
#' To define antibiotics column names, leave as it is to determine it automatically with [guess_ab_col()] or input a text (case-insensitive), or use `NULL` to skip a column (e.g. `TIC = NULL` to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning.

4
R/filter_ab_class.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' Filter isolates on result in antimicrobial class

4
R/first_isolate.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' Determine first (weighted) isolates

4
R/g.test.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' *G*-test for Count Data

4
R/ggplot_pca.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' PCA biplot with `ggplot2`

12
R/ggplot_rsi.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,12 +16,12 @@ @@ -16,12 +16,12 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' AMR plots with `ggplot2`
#'
#' Use these functions to create bar plots for antimicrobial resistance analysis. All functions rely on internal [ggplot2][ggplot2::ggplot()] functions.
#' Use these functions to create bar plots for antimicrobial resistance analysis. All functions rely on [ggplot2][ggplot2::ggplot()] functions.
#' @inheritSection lifecycle Maturing lifecycle
#' @param data a [`data.frame`] with column(s) of class [`rsi`] (see [as.rsi()])
#' @param position position adjustment of bars, either `"fill"`, `"stack"` or `"dodge"`
@ -49,13 +49,13 @@ @@ -49,13 +49,13 @@
#'
#' [facet_rsi()] creates 2d plots (at default based on S/I/R) using [ggplot2::facet_wrap()].
#'
#' [scale_y_percent()] transforms the y axis to a 0 to 100% range using [ggplot2::scale_continuous()].
#' [scale_y_percent()] transforms the y axis to a 0 to 100% range using [ggplot2::scale_y_continuous()].
#'
#' [scale_rsi_colours()] sets colours to the bars: pastel blue for S, pastel turquoise for I and pastel red for R, using [ggplot2::scale_brewer()].
#' [scale_rsi_colours()] sets colours to the bars: pastel blue for S, pastel turquoise for I and pastel red for R, using [ggplot2::scale_fill_manual()].
#'
#' [theme_rsi()] is a [ggplot2 theme][[ggplot2::theme()] with minimal distraction.
#'
#' [labels_rsi_count()] print datalabels on the bars with percentage and amount of isolates using [ggplot2::geom_text()]
#' [labels_rsi_count()] print datalabels on the bars with percentage and amount of isolates using [ggplot2::geom_text()].
#'
#' [ggplot_rsi()] is a wrapper around all above functions that uses data as first input. This makes it possible to use this function after a pipe (`%>%`). See Examples.
#' @rdname ggplot_rsi

4
R/globals.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
globalVariables(c(".",

4
R/guess_ab_col.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' Guess antibiotic column

4
R/join_microorganisms.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' Join [microorganisms] to a data set

4
R/key_antibiotics.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' Key antibiotics for first *weighted* isolates

4
R/kurtosis.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
# #
# SOURCE #
# https://gitlab.com/msberends/AMR #
# https://github.com/msberends/AMR #
# #
# LICENCE #
# (c) 2018-2020 Berends MS, Luz CF et al. #
@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
# 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 more info: https://msberends.gitlab.io/AMR. #
# Visit our website for more info: https://msberends.github.io/AMR. #
# ==================================================================== #
#' Kurtosis of the sample

6
R/lifecycle.R

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
# Antimicrobial Resistance (AMR) Analysis #
#