2018-09-08 16:06:47 +02:00
|
|
|
# ==================================================================== #
|
|
|
|
# TITLE #
|
2021-02-02 23:57:35 +01:00
|
|
|
# Antimicrobial Resistance (AMR) Data Analysis for R #
|
2018-09-08 16:06:47 +02:00
|
|
|
# #
|
2019-01-02 23:24:07 +01:00
|
|
|
# SOURCE #
|
2020-07-08 14:48:06 +02:00
|
|
|
# https://github.com/msberends/AMR #
|
2018-09-08 16:06:47 +02:00
|
|
|
# #
|
|
|
|
# LICENCE #
|
2020-12-27 00:30:28 +01:00
|
|
|
# (c) 2018-2021 Berends MS, Luz CF et al. #
|
2020-10-08 11:16:03 +02:00
|
|
|
# Developed at the University of Groningen, the Netherlands, in #
|
|
|
|
# collaboration with non-profit organisations Certe Medical #
|
|
|
|
# Diagnostics & Advice, and University Medical Center Groningen. #
|
2018-09-08 16:06:47 +02:00
|
|
|
# #
|
2019-01-02 23:24:07 +01:00
|
|
|
# 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. #
|
2020-01-05 17:22:09 +01:00
|
|
|
# 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. #
|
2020-10-08 11:16:03 +02:00
|
|
|
# #
|
|
|
|
# Visit our website for the full manual and a complete tutorial about #
|
2021-02-02 23:57:35 +01:00
|
|
|
# how to conduct AMR data analysis: https://msberends.github.io/AMR/ #
|
2018-09-08 16:06:47 +02:00
|
|
|
# ==================================================================== #
|
|
|
|
|
2020-12-29 21:23:01 +01:00
|
|
|
# set up package environment, used by numerous AMR functions
|
|
|
|
pkg_env <- new.env(hash = FALSE)
|
2021-01-12 22:08:04 +01:00
|
|
|
pkg_env$mo_failed <- character(0)
|
2020-12-29 21:23:01 +01:00
|
|
|
|
2018-04-19 14:10:57 +02:00
|
|
|
.onLoad <- function(libname, pkgname) {
|
2020-09-29 23:35:46 +02:00
|
|
|
# Support for tibble headers (type_sum) and tibble columns content (pillar_shaft)
|
|
|
|
# without the need to depend on other packages. This was suggested by the
|
|
|
|
# developers of the vctrs package:
|
2020-09-12 08:49:01 +02:00
|
|
|
# https://github.com/r-lib/vctrs/blob/05968ce8e669f73213e3e894b5f4424af4f46316/R/register-s3.R
|
2020-08-26 15:34:12 +02:00
|
|
|
s3_register("pillar::pillar_shaft", "ab")
|
2020-08-26 11:33:54 +02:00
|
|
|
s3_register("pillar::pillar_shaft", "mo")
|
|
|
|
s3_register("pillar::pillar_shaft", "rsi")
|
|
|
|
s3_register("pillar::pillar_shaft", "mic")
|
|
|
|
s3_register("pillar::pillar_shaft", "disk")
|
2020-10-08 11:16:03 +02:00
|
|
|
s3_register("tibble::type_sum", "ab")
|
|
|
|
s3_register("tibble::type_sum", "mo")
|
|
|
|
s3_register("tibble::type_sum", "rsi")
|
|
|
|
s3_register("tibble::type_sum", "mic")
|
2020-08-26 11:33:54 +02:00
|
|
|
s3_register("tibble::type_sum", "disk")
|
2020-09-29 23:35:46 +02:00
|
|
|
# Support for frequency tables from the cleaner package
|
2020-08-28 21:55:47 +02:00
|
|
|
s3_register("cleaner::freq", "mo")
|
|
|
|
s3_register("cleaner::freq", "rsi")
|
2020-09-29 23:35:46 +02:00
|
|
|
# Support from skim() from the skimr package
|
2020-09-28 01:08:55 +02:00
|
|
|
s3_register("skimr::get_skimmers", "mo")
|
|
|
|
s3_register("skimr::get_skimmers", "rsi")
|
|
|
|
s3_register("skimr::get_skimmers", "mic")
|
|
|
|
s3_register("skimr::get_skimmers", "disk")
|
2021-02-26 12:11:29 +01:00
|
|
|
s3_register("ggplot2::ggplot", "rsi")
|
2021-02-25 10:33:08 +01:00
|
|
|
s3_register("ggplot2::ggplot", "mic")
|
|
|
|
s3_register("ggplot2::ggplot", "disk")
|
2020-12-24 23:29:10 +01:00
|
|
|
|
|
|
|
# if mo source exists, fire it up (see mo_source())
|
|
|
|
try({
|
|
|
|
if (file.exists(getOption("AMR_mo_source", "~/mo_source.rds"))) {
|
|
|
|
invisible(get_mo_source())
|
|
|
|
}
|
|
|
|
}, silent = TRUE)
|
2018-04-19 14:10:57 +02:00
|
|
|
}
|