diff --git a/DESCRIPTION b/DESCRIPTION index 3638d34f..60dfbaf1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 0.5.0.9015 +Version: 0.5.0.9016 Date: 2019-01-29 Title: Antimicrobial Resistance Analysis Authors@R: c( diff --git a/NAMESPACE b/NAMESPACE index 51b0f4ac..50cf58d0 100755 --- a/NAMESPACE +++ b/NAMESPACE @@ -253,7 +253,7 @@ importFrom(graphics,plot) importFrom(graphics,text) importFrom(hms,is.hms) importFrom(knitr,kable) -importFrom(rlang,as_name) +importFrom(rlang,as_label) importFrom(rlang,enquos) importFrom(rlang,eval_tidy) importFrom(stats,complete.cases) diff --git a/R/data.R b/R/data.R index 0843ee78..673d381f 100755 --- a/R/data.R +++ b/R/data.R @@ -42,13 +42,14 @@ #' \item{\code{useful_gramnegative}}{\code{FALSE} if not useful according to EUCAST, \code{NA} otherwise (see Source)} #' \item{\code{useful_grampositive}}{\code{FALSE} if not useful according to EUCAST, \code{NA} otherwise (see Source)} #' } -#' @source - World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: \url{https://www.whocc.no/atc_ddd_index/} +#' @source World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: \url{https://www.whocc.no/atc_ddd_index/} #' #' Table antibiotic coding EARSS (from WHONET 5.3): \url{http://www.madsonline.dk/Tutorials/landskoder_antibiotika_WM.pdf} #' #' EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes Tables. Version 3.1, 2016: \url{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf} #' #' European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{http://ec.europa.eu/health/documents/community-register/html/atc.htm} +#' @inheritSection WHOCC WHOCC #' @inheritSection AMR Read more on our website! #' @seealso \code{\link{microorganisms}} # use this later to further fill AMR::antibiotics @@ -203,6 +204,41 @@ #' @inheritSection AMR Read more on our website! "septic_patients" +#' Data set with 500 isolates - WHONET example +#' +#' This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The data itself was based on our \code{\link{septic_patients}} data set. +#' @format A \code{\link{data.frame}} with 500 observations and 53 variables: +#' \describe{ +#' \item{\code{Identification number}}{ID of the sample} +#' \item{\code{Specimen number}}{ID of the specimen} +#' \item{\code{Organism}}{Microorganisms, can be coerced with \code{\link{as.mo}}} +#' \item{\code{Country}}{Country of origin} +#' \item{\code{Laboratory}}{Name of laboratory} +#' \item{\code{Last name}}{Last name of patient} +#' \item{\code{First name}}{Initial of patient} +#' \item{\code{Sex}}{Gender of patient} +#' \item{\code{Age}}{Age of patient} +#' \item{\code{Age category}}{Age group, can also be looked up using \code{\link{age_groups}}} +#' \item{\code{Date of admission}}{Date of hospital admission} +#' \item{\code{Specimen date}}{Date when specimen was received at laboratory} +#' \item{\code{Specimen type}}{Specimen type or group} +#' \item{\code{Specimen type (Numeric)}}{Translation of \code{"Specimen type"}} +#' \item{\code{Reason}}{Reason of request with Differential Diagnosis} +#' \item{\code{Isolate number}}{ID of isolate} +#' \item{\code{Organism type}}{Type of microorganism, can also be looked up using \code{\link{mo_type}}} +#' \item{\code{Serotype}}{Serotype of microorganism} +#' \item{\code{Beta-lactamase}}{Microorganism produces beta-lactamase?} +#' \item{\code{ESBL}}{Microorganism produces extended spectrum beta-lactamase?} +#' \item{\code{Carbapenemase}}{Microorganism produces carbapenemase?} +#' \item{\code{MRSA screening test}}{Microorganism is possible MRSA?} +#' \item{\code{Inducible clindamycin resistance}}{Clindamycin can be induced?} +#' \item{\code{Comment}}{Other comments} +#' \item{\code{Date of data entry}}{Date this data was entered in WHONET} +#' \item{\code{AMP_ND10:CIP_EE}}{27 different antibiotics. You can lookup the abbreviatons in the \code{\link{antibiotics}} data set, or use e.g. \code{\link{atc_name}("AMP")} to get the official name immediately.} +#' } +#' @inheritSection AMR Read more on our website! +"WHONET" + #' Supplementary Data #' #' These \code{\link{data.table}s} are transformed from the \code{\link{microorganisms}} and \code{\link{microorganisms}} data sets to improve speed of \code{\link{as.mo}}. They are meant for internal use only, and are only mentioned here for reference. diff --git a/R/first_isolate.R b/R/first_isolate.R index 8b5c13f8..46e16bd5 100755 --- a/R/first_isolate.R +++ b/R/first_isolate.R @@ -206,7 +206,14 @@ first_isolate <- function(tbl, # -- patient id if (is.null(col_patient_id)) { + if (all(c("First name", "Last name", "Sex", "Identification number") %in% colnames(tbl))) { + # WHONET support + tbl <- tbl %>% mutate(patient_id = paste(`First name`, `Last name`, Sex)) + col_patient_id <- "patient_id" + message(blue(paste0("NOTE: Using combined columns ", bold("`First name`, `Last name` and `Sex`"), " as input for `col_patient_id`."))) + } else { col_patient_id <- search_type_in_df(tbl = tbl, type = "patient_id") + } } if (is.null(col_patient_id)) { stop("`col_patient_id` must be set.", call. = FALSE) diff --git a/R/freq.R b/R/freq.R index 37d23823..0bf89807 100755 --- a/R/freq.R +++ b/R/freq.R @@ -71,7 +71,7 @@ #' @importFrom utils browseVignettes #' @importFrom hms is.hms #' @importFrom crayon red green silver -#' @importFrom rlang enquos eval_tidy as_name +#' @importFrom rlang enquos eval_tidy as_label #' @keywords summary summarise frequency freq #' @rdname freq #' @name freq @@ -206,6 +206,7 @@ frequency_tbl <- function(x, # x_haslevels <- !is.null(levels(x)) x.name <- NULL cols <- NULL + cols.names <- NULL if (any(class(x) == "list")) { cols <- names(x) x <- as.data.frame(x, stringsAsFactors = FALSE) @@ -224,9 +225,19 @@ frequency_tbl <- function(x, if (is.null(x.name)) { x.name <- deparse(substitute(x)) } - if (x.name == ".") { - x.name <- NULL + if (x.name %like% "(%>%)") { + x.name <- x.name %>% strsplit("%>%", fixed = TRUE) %>% unlist() %>% .[1] %>% trimws() } + if (x.name == ".") { + x.name <- "a data.frame" + } + x.name <- paste0("`", x.name, "`") + x.name.dims <- x %>% + dim() %>% + format(decimal.mark = decimal.mark, big.mark = big.mark) %>% + trimws() %>% + paste(collapse = " x ") + x.name <- paste0(x.name, " (", x.name.dims, ")") x.group <- group_vars(x) if (length(x.group) > 1) { @@ -238,24 +249,19 @@ frequency_tbl <- function(x, if (length(user_exprs) > 0) { new_list <- list(0) - for (i in 1:length(user_exprs)) { new_list[[i]] <- eval_tidy(user_exprs[[i]], data = x) - this_name <- try( as_name(user_exprs[[i]]) , silent = TRUE) - if (class(this_name) == "try-error") { - this_name <- paste0("V", i) - } - cols <- c(cols, this_name) + cols <- c(cols, as_label(user_exprs[[i]])) } if (length(new_list) == 1 & length(x.group) == 0) { # is now character x <- new_list[[1]] df <- NULL - cols <- NULL } else { # create data frame - df <- as.data.frame(new_list, col.names = paste0("V", 1:length(new_list)), stringsAsFactors = FALSE) + df <- as.data.frame(new_list, col.names = cols, stringsAsFactors = FALSE) + cols.names <- colnames(df) } } else { # complete data frame @@ -264,7 +270,7 @@ frequency_tbl <- function(x, # support grouping variables if (length(x.group) > 0) { - x.group_cols <- c(x.group, cols) + x.group_cols <- c(x.group, cols.names) x <- bind_cols(x, df) # if (droplevels == TRUE) { # x <- x %>% mutate_at(vars(x.group_cols), droplevels) @@ -302,11 +308,10 @@ frequency_tbl <- function(x, # no groups, multiple values like: septic_patients %>% freq(mo, mo_genus(mo)) x <- df df <- NULL - cols <- NULL } } if (length(cols) > 0 & is.data.frame(x)) { - x <- x[, cols] + x <- x[, cols.names] } } else if (any(class(x) == "table")) { @@ -328,6 +333,7 @@ frequency_tbl <- function(x, x <- x %>% pull(1) } else if (ncol(x) < 10) { mult.columns <- ncol(x) + # paste old columns together x <- do.call(paste, c(x[colnames(x)], sep = sep)) } else { stop("A maximum of 9 columns can be analysed at the same time.", call. = FALSE) diff --git a/R/misc.R b/R/misc.R index 4b0a696f..ec634752 100755 --- a/R/misc.R +++ b/R/misc.R @@ -152,7 +152,10 @@ search_type_in_df <- function(tbl, type) { # -- date if (type == "date") { for (i in 1:ncol(tbl)) { - if ("Date" %in% class(tbl %>% pull(i)) | "POSIXct" %in% class(tbl %>% pull(i))) { + if (any(colnames(tbl) %like% "^(Specimen date)")) { + # WHONET support + found <- colnames(tbl)[colnames(tbl) %like% "^(Specimen date)"][1] + } else if ("Date" %in% class(tbl %>% pull(i)) | "POSIXct" %in% class(tbl %>% pull(i))) { found <- colnames(tbl)[i] break } diff --git a/R/zzz.R b/R/zzz.R index 592756bc..5b7f859c 100755 --- a/R/zzz.R +++ b/R/zzz.R @@ -21,19 +21,34 @@ #' The \code{AMR} Package #' -#' Welcome to the \code{AMR} package. This page gives some additional contact information about the authors. +#' Welcome to the \code{AMR} package. #' @details -#' This package was intended to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods. +#' \code{AMR} is a free and open-source R package to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods. It supports any table format, including WHONET/EARS-Net data. #' -#' This package was created for both academic research and routine analysis by PhD students of the Faculty of Medical Sciences of the University of Groningen and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). -#' @section Read more on our website!: -#' \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -#' On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +#' We created this package for both academic research and routine analysis at the Faculty of Medical Sciences of the University of Groningen and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). This R package is actively maintained and free software; you can freely use and distribute it for both personal and commercial (but not patent) purposes under the terms of the GNU General Public License version 2.0 (GPL-2), as published by the Free Software Foundation. +#' +#' This package can be used for: +#' \itemize{ +#' \item{Calculating antimicrobial resistance} +#' \item{Predicting antimicrobial resistance using regression models} +#' \item{Getting properties for any microorganism (like Gram stain, species, genus or family)} +#' \item{Getting properties for any antibiotic (like name, ATC code, defined daily dose or trade name)} +#' \item{Plotting antimicrobial resistance} +#' \item{Determining first isolates to be used for AMR analysis} +#' \item{Applying EUCAST rules} +#' \item{Determining multi-drug resistance organisms (MDRO)} +#' \item{Descriptive statistics: frequency tables, kurtosis and skewness} +#' } #' @section Authors: #' Matthijs S. Berends[1,2] Christian F. Luz[1], Erwin E.A. Hassing[2], Corinna Glasner[1], Alex W. Friedrich[1], Bhanu N.M. Sinha[1] \cr #' #' [1] Department of Medical Microbiology, University of Groningen, University Medical Center Groningen, Groningen, the Netherlands - \url{rug.nl} \url{umcg.nl} \cr #' [2] Certe Medical Diagnostics & Advice, Groningen, the Netherlands - \url{certe.nl} + +#' @section Read more on our website!: +#' \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} +#' On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. + #' @section Contact us: #' For suggestions, comments or questions, please contact us at: #' diff --git a/_pkgdown.yml b/_pkgdown.yml index c896b0ff..10518726 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -136,6 +136,7 @@ reference: - '`antibiotics`' - '`microorganisms`' - '`septic_patients`' + - '`WHONET`' - '`microorganisms.codes`' - '`microorganisms.old`' - '`supplementary_data`' diff --git a/data/WHONET.rda b/data/WHONET.rda new file mode 100644 index 00000000..4c642251 Binary files /dev/null and b/data/WHONET.rda differ diff --git a/data/antibiotics.rda b/data/antibiotics.rda index 6782d134..2f309d6c 100755 Binary files a/data/antibiotics.rda and b/data/antibiotics.rda differ diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 8c3c0770..708f719b 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -78,7 +78,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/articles/AMR.html b/docs/articles/AMR.html index af02aedf..09e907f5 100644 --- a/docs/articles/AMR.html +++ b/docs/articles/AMR.html @@ -185,7 +185,7 @@

How to conduct AMR analysis

Matthijs S. Berends

-

28 January 2019

+

29 January 2019

@@ -194,7 +194,7 @@ -

Note: values on this page will change with every website update since they are based on randomly created values and the page was written in RMarkdown. However, the methodology remains unchanged. This page was generated on 28 January 2019.

+

Note: values on this page will change with every website update since they are based on randomly created values and the page was written in RMarkdown. However, the methodology remains unchanged. This page was generated on 29 January 2019.

Introduction

@@ -210,21 +210,21 @@ -2019-01-28 +2019-01-29 abcd Escherichia coli S S -2019-01-28 +2019-01-29 abcd Escherichia coli S R -2019-01-28 +2019-01-29 efgh Escherichia coli R @@ -285,18 +285,18 @@

Put everything together

-

Using the sample() function, we can randomly select items from all objects we defined earlier. To let our fake data reflect reality a bit, we will also approximately define the probabilities of bacteria and the antibiotic results with the prob parameter.

-
data <- data.frame(date = sample(dates, 5000, replace = TRUE),
-                   patient_id = sample(patients, 5000, replace = TRUE),
-                   hospital = sample(hospitals, 5000, replace = TRUE, prob = c(0.30, 0.35, 0.15, 0.20)),
-                   bacteria = sample(bacteria, 5000, replace = TRUE, prob = c(0.50, 0.25, 0.15, 0.10)),
-                   amox = sample(ab_interpretations, 5000, replace = TRUE, prob = c(0.60, 0.05, 0.35)),
-                   amcl = sample(ab_interpretations, 5000, replace = TRUE, prob = c(0.75, 0.10, 0.15)),
-                   cipr = sample(ab_interpretations, 5000, replace = TRUE, prob = c(0.80, 0.00, 0.20)),
-                   gent = sample(ab_interpretations, 5000, replace = TRUE, prob = c(0.92, 0.00, 0.08))
+

Using the sample() function, we can randomly select items from all objects we defined earlier. To let our fake data reflect reality a bit, we will also approximately define the probabilities of bacteria and the antibiotic results with the prob parameter.

+
data <- data.frame(date = sample(dates, 5000, replace = TRUE),
+                   patient_id = sample(patients, 5000, replace = TRUE),
+                   hospital = sample(hospitals, 5000, replace = TRUE, prob = c(0.30, 0.35, 0.15, 0.20)),
+                   bacteria = sample(bacteria, 5000, replace = TRUE, prob = c(0.50, 0.25, 0.15, 0.10)),
+                   amox = sample(ab_interpretations, 5000, replace = TRUE, prob = c(0.60, 0.05, 0.35)),
+                   amcl = sample(ab_interpretations, 5000, replace = TRUE, prob = c(0.75, 0.10, 0.15)),
+                   cipr = sample(ab_interpretations, 5000, replace = TRUE, prob = c(0.80, 0.00, 0.20)),
+                   gent = sample(ab_interpretations, 5000, replace = TRUE, prob = c(0.92, 0.00, 0.08))
                    )
-

Using the left_join() function from the dplyr package, we can ‘map’ the gender to the patient ID using the patients_table object we created earlier:

- +

Using the left_join() function from the dplyr package, we can ‘map’ the gender to the patient ID using the patients_table object we created earlier:

+

The resulting data set contains 5,000 blood culture isolates. With the head() function we can preview the first 6 values of this data set:

head(data)
@@ -313,69 +313,69 @@ - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -396,15 +396,15 @@ # # Item Count Percent Cum. Count Cum. Percent # --- ----- ------ -------- ----------- ------------- -# 1 M 2,640 52.8% 2,640 52.8% -# 2 F 2,360 47.2% 5,000 100.0% +# 1 M 2,586 51.7% 2,586 51.7% +# 2 F 2,414 48.3% 5,000 100.0%

So, we can draw at least two conclusions immediately. From a data scientist perspective, the data looks clean: only values M and F. From a researcher perspective: there are slightly more men. Nothing we didn’t already know.

-

The data is already quite clean, but we still need to transform some variables. The bacteria column now consists of text, and we want to add more variables based on microbial IDs later on. So, we will transform this column to valid IDs. The mutate() function of the dplyr package makes this really easy:

+

The data is already quite clean, but we still need to transform some variables. The bacteria column now consists of text, and we want to add more variables based on microbial IDs later on. So, we will transform this column to valid IDs. The mutate() function of the dplyr package makes this really easy:

data <- data %>%
-  mutate(bacteria = as.mo(bacteria))
-

We also want to transform the antibiotics, because in real life data we don’t know if they are really clean. The as.rsi() function ensures reliability and reproducibility in these kind of variables. The mutate_at() will run the as.rsi() function on defined variables:

+ mutate(bacteria =as.mo(bacteria)) +

We also want to transform the antibiotics, because in real life data we don’t know if they are really clean. The as.rsi() function ensures reliability and reproducibility in these kind of variables. The mutate_at() will run the as.rsi() function on defined variables:

data <- data %>%
-  mutate_at(vars(amox:gent), as.rsi)
+ mutate_at(vars(amox:gent), as.rsi)

Finally, we will apply EUCAST rules on our antimicrobial results. In Europe, most medical microbiological laboratories already apply these rules. Our package features their latest insights on intrinsic resistance and exceptional phenotypes. Moreover, the eucast_rules() function can also apply additional rules, like forcing ampicillin = R when amoxicillin/clavulanic acid = R.

Because the amoxicillin (column amox) and amoxicillin/clavulanic acid (column amcl) in our data were generated randomly, some rows will undoubtedly contain amox = S and amcl = R, which is technically impossible. The eucast_rules() fixes this:

+# => EUCAST rules affected 1,853 out of 5,000 rows -> changed 1,046 test results.

Adding new variables

Now that we have the microbial ID, we can add some taxonomic properties:

data <- data %>% 
-  mutate(gramstain = mo_gramstain(bacteria),
+  mutate(gramstain = mo_gramstain(bacteria),
          genus = mo_genus(bacteria),
          species = mo_species(bacteria))
@@ -468,14 +468,14 @@

This AMR package includes this methodology with the first_isolate() function. It adopts the episode of a year (can be changed by user) and it starts counting days after every selected isolate. This new variable can easily be added to our data:

-

So only 58.8% is suitable for resistance analysis! We can now filter on is with the filter() function, also from the dplyr package:

+# => Found 2,926 first isolates (58.5% of total)
+

So only 58.5% is suitable for resistance analysis! We can now filter on is with the filter() function, also from the dplyr package:

+ filter(first == TRUE)

For future use, the above two syntaxes can be shortened with the filter_first_isolate() function:

@@ -499,41 +499,52 @@ - - + + + + - - - - + + + - + - - + - - + + - + - - + + + + + + + + + + + + + @@ -541,32 +552,21 @@ - - - - - - - - - - - - - + + - + - - + + @@ -576,8 +576,30 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -585,42 +607,20 @@ - - - - - - - - - - - - - - - - - - - - - -
2011-12-05N62015-02-23C5 Hospital BEscherichia coliStaphylococcus aureus RISSF
2012-08-21O9Hospital BStreptococcus pneumoniaeIRRSF
2015-10-17P4Hospital DEscherichia coliSSSSF
2014-03-12V8Hospital AEscherichia coliSSRSF
2015-04-17L3Hospital DEscherichia coliS R S S M
2012-09-29Q102011-10-29X2Hospital CStreptococcus pneumoniaeRSSSF
2010-06-10J5 Hospital B Escherichia coli S S S SM
2013-11-09U4Hospital AEscherichia coliRSSSF
2010-10-12C3Hospital AStaphylococcus aureusSISSM
2017-12-04T3Hospital CEscherichia coliRSSS F
12010-02-22Y82010-08-27X6 B_ESCHR_COLSS R SSS TRUE
22011-11-07Y82010-12-12X6 B_ESCHR_COLR SIR SSTRUEFALSE
32012-05-14Y82011-05-24X6 B_ESCHR_COLI R S SS FALSE
42012-10-27Y82011-09-03X6B_ESCHR_COLSSRSTRUE
52011-09-21X6 B_ESCHR_COL S SS FALSE
52013-03-26Y8B_ESCHR_COLSISSTRUE
62013-05-26Y82011-10-31X6 B_ESCHR_COLS R S RS FALSE
72013-10-20Y82012-07-02X6 B_ESCHR_COL S S
82015-03-07Y82012-12-30X6B_ESCHR_COLSSSSTRUE
92013-03-15X6B_ESCHR_COLSSSSFALSE
102014-01-14X6 B_ESCHR_COL S RS TRUE
92015-03-20Y8B_ESCHR_COLSISSFALSE
102015-10-18Y8B_ESCHR_COLRSSSFALSE

Only 4 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and show be included too. This is why we weigh isolates, based on their antibiogram. The key_antibiotics() function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.

If a column exists with a name like ‘key(…)ab’ the first_isolate() function will automatically use it and determine the first weighted isolates. Mind the NOTEs in below output:

+# => Found 4,404 first weighted isolates (88.1% of total)
@@ -637,80 +637,80 @@ - - + + + + - - - - + + + - + - - + - - + + - + - + - - + + + - - + - - + + - - + + - - + + - + - - + + @@ -721,11 +721,11 @@ - - + + - + @@ -733,11 +733,11 @@ - - + + - + @@ -745,26 +745,26 @@ - - + + + - - +
isolate
12010-02-22Y82010-08-27X6 B_ESCHR_COLSS R SSS TRUE TRUE
22011-11-07Y82010-12-12X6 B_ESCHR_COLR SIR SSTRUEFALSE TRUE
32012-05-14Y82011-05-24X6 B_ESCHR_COLI R S SS FALSEFALSETRUE
42012-10-27Y82011-09-03X6 B_ESCHR_COL S SR SSFALSETRUE TRUE
52013-03-26Y82011-09-21X6 B_ESCHR_COL SI S STRUESFALSE TRUE
62013-05-26Y82011-10-31X6 B_ESCHR_COLS R S RS FALSE TRUE
72013-10-20Y82012-07-02X6 B_ESCHR_COL S S
82015-03-07Y82012-12-30X6 B_ESCHR_COL SRS S S TRUE
92015-03-20Y82013-03-15X6 B_ESCHR_COL SIS S S FALSE
102015-10-18Y82014-01-14X6 B_ESCHR_COLS R S SSFALSETRUE TRUE
-

Instead of 4, now 8 isolates are flagged. In total, 89% of all isolates are marked ‘first weighted’ - 147.9% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.

+

Instead of 4, now 9 isolates are flagged. In total, 88.1% of all isolates are marked ‘first weighted’ - 146.6% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.

As with filter_first_isolate(), there’s a shortcut for this new algorithm too:

-

So we end up with 4,452 isolates for analysis.

+

So we end up with 4,404 isolates for analysis.

We can remove unneeded columns:

+ select(-c(first, keyab))

Now our data looks like:

head(data_1st)
@@ -785,28 +785,28 @@ - - + + - + + - - - - - + + + + - - - + + + - - + + @@ -815,44 +815,14 @@ - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -860,13 +830,43 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -889,7 +889,7 @@
data_1st %>% freq(genus, species)

Frequency table
Columns: 2
-Length: 4,452 (of which NA: 0 = 0.00%)
+Length: 4,404 (of which NA: 0 = 0.00%)
Unique: 4

Shortest: 16
Longest: 24

@@ -906,33 +906,33 @@ Longest: 24

- - - - + + + + - - - - + + + + - - - - + + + + - - - + + + @@ -942,11 +942,11 @@ Longest: 24

Resistance percentages

The functions portion_R, portion_RI, portion_I, portion_IS and portion_S can be used to determine the portion of a specific antimicrobial outcome. They can be used on their own:

data_1st %>% portion_IR(amox)
-# [1] 0.4775382
-

Or can be used in conjuction with group_by() and summarise(), both from the dplyr package:

+# [1] 0.4713896 +

Or can be used in conjuction with group_by() and summarise(), both from the dplyr package:

data_1st %>% 
-  group_by(hospital) %>% 
-  summarise(amoxicillin = portion_IR(amox))
+ group_by(hospital) %>% + summarise(amoxicillin =portion_IR(amox))
2011-12-05N62015-02-23C5 Hospital BB_ESCHR_COLB_STPHY_AURR RI S SFGram negativeEscherichiacoliMGram positiveStaphylococcusaureus TRUE
2012-08-21O9Hospital B2011-10-29X2Hospital C B_STRPTC_PNEIR RSS R F Gram positiveTRUE
2015-10-17P4Hospital D2010-06-10J5Hospital B B_ESCHR_COL S S S SFGram negativeEscherichiacoliTRUE
2014-03-12V8Hospital AB_ESCHR_COLSSRSFGram negativeEscherichiacoliTRUE
2015-04-17L3Hospital DB_ESCHR_COLSRSS M Gram negative EscherichiaTRUE
2012-09-29Q10Hospital B2013-11-09U4Hospital A B_ESCHR_COLR S S SFGram negativeEscherichiacoliTRUE
2010-10-12C3Hospital AB_STPHY_AURSISSMGram positiveStaphylococcusaureusTRUE
2017-12-04T3Hospital CB_ESCHR_COLRSS S F Gram negative
1 Escherichia coli2,19549.3%2,19549.3%2,16549.2%2,16549.2%
2 Staphylococcus aureus1,14225.7%3,33775.0%1,07824.5%3,24373.6%
3 Streptococcus pneumoniae66615.0%4,00389.9%71916.3%3,96290.0%
4 Klebsiella pneumoniae44910.1%4,45244210.0%4,404 100.0%
@@ -955,26 +955,26 @@ Longest: 24

- + - + - + - +
hospital
Hospital A0.50038020.4852484
Hospital B0.45564010.4594419
Hospital C0.48298220.4875346
Hospital D0.47876860.4583822
-

Of course it would be very convenient to know the number of isolates responsible for the percentages. For that purpose the n_rsi() can be used, which works exactly like n_distinct() from the dplyr package. It counts all isolates available for every group (i.e. values S, I or R):

+

Of course it would be very convenient to know the number of isolates responsible for the percentages. For that purpose the n_rsi() can be used, which works exactly like n_distinct() from the dplyr package. It counts all isolates available for every group (i.e. values S, I or R):

data_1st %>% 
-  group_by(hospital) %>% 
-  summarise(amoxicillin = portion_IR(amox),
+  group_by(hospital) %>% 
+  summarise(amoxicillin = portion_IR(amox),
             available = n_rsi(amox))
@@ -985,30 +985,30 @@ Longest: 24

- - + + - - + + - - + + - - + +
Hospital A0.500380213150.48524841288
Hospital B0.455640115780.45944191541
Hospital C0.48298226170.4875346722
Hospital D0.47876869420.4583822853

These functions can also be used to get the portion of multiple antibiotics, to calculate co-resistance very easily:

data_1st %>% 
-  group_by(genus) %>% 
-  summarise(amoxicillin = portion_S(amcl),
+  group_by(genus) %>% 
+  summarise(amoxicillin = portion_S(amcl),
             gentamicin = portion_S(gent),
             "amox + gent" = portion_S(amcl, gent))
@@ -1021,67 +1021,67 @@ Longest: 24

- - - + + + - - - + + + - - - + + + - + - +
Escherichia0.73120730.89749430.97539860.72471130.92055430.9764434
Klebsiella0.75055680.93095770.97995550.77149320.90497740.9841629
Staphylococcus0.74080560.92294220.98511380.75417440.93135440.9860853
Streptococcus0.75225230.7593880 0.00000000.75225230.7593880

To make a transition to the next part, let’s see how this difference could be plotted:

data_1st %>% 
-  group_by(genus) %>% 
-  summarise("1. Amoxicillin" = portion_S(amcl),
+  group_by(genus) %>% 
+  summarise("1. Amoxicillin" = portion_S(amcl),
             "2. Gentamicin" = portion_S(gent),
             "3. Amox + gent" = portion_S(amcl, gent)) %>% 
-  tidyr::gather("Antibiotic", "S", -genus) %>%
-  ggplot(aes(x = genus,
+  tidyr::gather("Antibiotic", "S", -genus) %>%
+  ggplot(aes(x = genus,
              y = S,
              fill = Antibiotic)) +
-  geom_col(position = "dodge2")
+ geom_col(position = "dodge2")

Plots

To show results in plots, most R users would nowadays use the ggplot2 package. This package lets you create plots in layers. You can read more about it on their website. A quick example would look like these syntaxes:

-
ggplot(data = a_data_set,
-       mapping = aes(x = year,
+
ggplot(data = a_data_set,
+       mapping = aes(x = year,
                      y = value)) +
-  geom_col() +
-  labs(title = "A title",
+  geom_col() +
+  labs(title = "A title",
        subtitle = "A subtitle",
        x = "My X axis",
        y = "My Y axis")
 
-ggplot(a_data_set,
-       aes(year, value) +
-  geom_bar()
+ggplot(a_data_set, + aes(year, value) + + geom_bar()

The AMR package contains functions to extend this ggplot2 package, for example geom_rsi(). It automatically transforms data with count_df() or portion_df() and show results in stacked bars. Its simplest and shortest example:

-
ggplot(data_1st) +
+
ggplot(data_1st) +
   geom_rsi(translate_ab = FALSE)

Omit the translate_ab = FALSE to have the antibiotic codes (amox, amcl, cipr, gent) translated to official WHO names (amoxicillin, amoxicillin and betalactamase inhibitor, ciprofloxacin, gentamicin).

If we group on e.g. the genus column and add some additional functions from our package, we can create this:

+ theme(axis.text.y = element_text(face = "italic"))

To simplify this, we also created the ggplot_rsi() function, which combines almost all above functions:

data_1st %>% 
-  group_by(genus) %>%
+  group_by(genus) %>%
   ggplot_rsi(x = "genus",
              facet = "Antibiotic",
              breaks = 0:4 * 25,
              datalabels = FALSE) +
-  coord_flip()
+ coord_flip()

@@ -1137,12 +1137,12 @@ Longest: 24

We can transform the data and apply the test in only a couple of lines:

septic_patients %>%
-  filter(hospital_id %in% c("A", "D")) %>% # filter on only hospitals A and D
-  select(hospital_id, fosf) %>%            # select the hospitals and fosfomycin
-  group_by(hospital_id) %>%                # group on the hospitals
+  filter(hospital_id %in% c("A", "D")) %>% # filter on only hospitals A and D
+  select(hospital_id, fosf) %>%            # select the hospitals and fosfomycin
+  group_by(hospital_id) %>%                # group on the hospitals
   count_df(combine_IR = TRUE) %>%          # count all isolates per group (hospital_id)
-  tidyr::spread(hospital_id, Value) %>%    # transform output so A and D are columns
-  select(A, D) %>%                         # and select these only
+  tidyr::spread(hospital_id, Value) %>%    # transform output so A and D are columns
+  select(A, D) %>%                         # and select these only
   as.matrix() %>%                          # transform to good old matrix for fisher.test()
   fisher.test()                            # do Fisher's Exact Test
 # 
diff --git a/docs/articles/AMR_files/figure-html/plot 1-1.png b/docs/articles/AMR_files/figure-html/plot 1-1.png
index bed4123c..a7f40a3c 100644
Binary files a/docs/articles/AMR_files/figure-html/plot 1-1.png and b/docs/articles/AMR_files/figure-html/plot 1-1.png differ
diff --git a/docs/articles/AMR_files/figure-html/plot 3-1.png b/docs/articles/AMR_files/figure-html/plot 3-1.png
index 1b5d363b..5718311c 100644
Binary files a/docs/articles/AMR_files/figure-html/plot 3-1.png and b/docs/articles/AMR_files/figure-html/plot 3-1.png differ
diff --git a/docs/articles/AMR_files/figure-html/plot 4-1.png b/docs/articles/AMR_files/figure-html/plot 4-1.png
index 13ab47ff..5a2af150 100644
Binary files a/docs/articles/AMR_files/figure-html/plot 4-1.png and b/docs/articles/AMR_files/figure-html/plot 4-1.png differ
diff --git a/docs/articles/AMR_files/figure-html/plot 5-1.png b/docs/articles/AMR_files/figure-html/plot 5-1.png
index 9aa21099..f9ede70a 100644
Binary files a/docs/articles/AMR_files/figure-html/plot 5-1.png and b/docs/articles/AMR_files/figure-html/plot 5-1.png differ
diff --git a/docs/articles/EUCAST.html b/docs/articles/EUCAST.html
index 3e5fecf6..75d6a736 100644
--- a/docs/articles/EUCAST.html
+++ b/docs/articles/EUCAST.html
@@ -185,7 +185,7 @@
       

How to apply EUCAST rules

Matthijs S. Berends

-

28 January 2019

+

29 January 2019

diff --git a/docs/articles/G_test.html b/docs/articles/G_test.html index 41a1a366..4350cd59 100644 --- a/docs/articles/G_test.html +++ b/docs/articles/G_test.html @@ -185,7 +185,7 @@

How to use the G-test

Matthijs S. Berends

-

28 January 2019

+

29 January 2019

diff --git a/docs/articles/Predict.html b/docs/articles/Predict.html index ea6fe8e7..8e1b652d 100644 --- a/docs/articles/Predict.html +++ b/docs/articles/Predict.html @@ -185,7 +185,7 @@

How to predict antimicrobial resistance

Matthijs S. Berends

-

28 January 2019

+

29 January 2019

diff --git a/docs/articles/WHONET.html b/docs/articles/WHONET.html index a63b7a2c..bf9bffc7 100644 --- a/docs/articles/WHONET.html +++ b/docs/articles/WHONET.html @@ -40,7 +40,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016
@@ -185,7 +185,7 @@

How to work with WHONET data

Matthijs S. Berends

-

28 January 2019

+

29 January 2019

@@ -194,10 +194,188 @@ -

(will be available soon)

+
+

+Import of data

+

This tutorial assumes you already imported the WHONET data with e.g. the readxl package. In RStudio, this can be done using the menu button ‘Import Dataset’ in the tab ‘Environment’. Choose the option ‘From Excel’ and select your exported file. Make sure date fields are imported correctly.

+

An example syntax could look like this:

+
library(readxl)
+data <- read_excel(path = "path/to/your/file.xlsx")
+

This package comes with an example data set WHONET. We will use it for this analysis.

+
+
+

+Preparation

+

First, load the relevant packages if you did not yet did this. I use the tidyverse for all of my analyses. All of them. If you don’t know it yet, I suggest you read about it on their website: https://www.tidyverse.org/.

+
library(tidyverse)
+library(AMR)
+

We will have to transform some variables to simplify and automate the analysis:

+
    +
  • Microorganisms should be transformed to our own microorganism IDs (called an mo) using the ITIS reference data set, which contains all ~20,000 microorganisms from the taxonomic kingdoms Bacteria, Fungi and Protozoa. We do the tranformation with as.mo().
  • +
  • Antimicrobial results or interpretations have to be clean and valid. In other words, they should only contain values "S", "I" or "R". That is exactly where the as.rsi() function is for.
  • +
+ +

No errors or warnings, so all values are transformed succesfully. Let’s check it though, with a couple of frequency tables:

+ +

Frequency table of mo from a data.frame (500 x 54)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ItemCountPercentCum. CountCum. Percent
1B_ESCHR_COL12725.4%12725.4%
2B_STPHY_CNS8016.0%20741.4%
3B_STPHY_AUR5010.0%25751.4%
4B_STPHY_EPI377.4%29458.8%
5B_STRPTC_PNE316.2%32565.0%
6B_STPHY_HOM234.6%34869.6%
7B_PROTS_MIR132.6%36172.2%
8B_KLBSL_PNE112.2%37274.4%
9B_PDMNS_AER81.6%38076.0%
10B_STPHY_CAP81.6%38877.6%
+

(omitted 46 entries, n = 112 [22.4%])

+ +

Frequency table of AMC_ND2 from a data.frame (500 x 54)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ItemCountPercentCum. CountCum. Percent
1S32671.0%32671.0%
2R11124.2%43795.2%
3I224.8%459100.0%
+
+
+

+Analysis

+

(more will be available soon)

+
diff --git a/docs/articles/ab_property.html b/docs/articles/ab_property.html index e9ab22eb..fda109af 100644 --- a/docs/articles/ab_property.html +++ b/docs/articles/ab_property.html @@ -185,7 +185,7 @@

How to get properties of an antibiotic

Matthijs S. Berends

-

28 January 2019

+

29 January 2019

diff --git a/docs/articles/benchmarks.html b/docs/articles/benchmarks.html index 14d3b463..4742b5cd 100644 --- a/docs/articles/benchmarks.html +++ b/docs/articles/benchmarks.html @@ -185,7 +185,7 @@

Benchmarks

Matthijs S. Berends

-

28 January 2019

+

29 January 2019

@@ -247,15 +247,15 @@
library(dplyr)
 # take 500,000 random MO codes from the septic_patients data set
 x = septic_patients %>%
-  sample_n(500000, replace = TRUE) %>%
-  pull(mo)
+  sample_n(500000, replace = TRUE) %>%
+  pull(mo)
   
 # got the right length?
 length(x)
 # [1] 500000
 
 # and how many unique values do we have?
-n_distinct(x)
+n_distinct(x)
 # [1] 96
 
 # only 96, but distributed in 500,000 results. now let's see:
diff --git a/docs/articles/freq.html b/docs/articles/freq.html
index 1bf094bf..e84f4724 100644
--- a/docs/articles/freq.html
+++ b/docs/articles/freq.html
@@ -185,7 +185,7 @@
       

How to create frequency tables

Matthijs S. Berends

-

28 January 2019

+

29 January 2019

diff --git a/docs/articles/index.html b/docs/articles/index.html index 510e651c..25f9296c 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016
diff --git a/docs/articles/mo_property.html b/docs/articles/mo_property.html index 3b565b7c..76677e4f 100644 --- a/docs/articles/mo_property.html +++ b/docs/articles/mo_property.html @@ -185,7 +185,7 @@

How to get properties of a microorganism

Matthijs S. Berends

-

28 January 2019

+

29 January 2019

diff --git a/docs/authors.html b/docs/authors.html index 30d97985..16515c2a 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -78,7 +78,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/index.html b/docs/index.html index 289501ae..8e236023 100644 --- a/docs/index.html +++ b/docs/index.html @@ -42,7 +42,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 @@ -190,7 +190,7 @@

(TLDR - to find out how to conduct AMR analysis, please continue reading here to get started.


AMR is a free and open-source R package to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods. It supports any table format, including WHONET/EARS-Net data.

-

We created this package for both academic research and routine analysis at the Faculty of Medical Sciences of the University of Groningen and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). This R package is actively maintained and free software; you can freely use and distribute it for both personal and commercial (but not patent) purposes under the terms of the GNU General Public Licence version 2.0 (GPL-2), as published by the Free Software Foundation. Read the full licence here.

+

We created this package for both academic research and routine analysis at the Faculty of Medical Sciences of the University of Groningen and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). This R package is actively maintained and free software; you can freely use and distribute it for both personal and commercial (but not patent) purposes under the terms of the GNU General Public License version 2.0 (GPL-2), as published by the Free Software Foundation. Read the full license here.

This package can be used for:

This package is ready-to-use for a professional environment by specialists in the following fields:

@@ -251,7 +251,7 @@

WHONET / EARS-Net

-

We support data (exported files) from WHONET. The AMR package contains a data set antibiotics which also contains all EARS-Net antibiotic abbreviations. Furthermore, when using WHONET data as input for analysis all input parameters will be set automatically.

+

We support WHONET and EARS-Net data. Exported files from WHONET can be imported into R and can be analysed easily using this package. For education purposes, we created an example data set WHONET with the exact same structure and a WHONET export file. Furthermore, this package also contains a data set antibiotics with all EARS-Net antibiotic abbreviations. When using WHONET data as input for analysis, all input parameters will be set automatically.

Read our tutorial about how to work with WHONET data here.

@@ -277,7 +277,7 @@

The AMR package basically does four important things:

  1. -

    It cleanses existing data, by transforming it to reproducible and profound classes, making the most efficient use of R. These functions all use artificial intelligence to guess results that you would expect:

    +

    It cleanses existing data by providing new classes for microoganisms, antibiotics and antimicrobial results (both S/I/R and MIC). With this package, you learn R everything about microbiology that is needed for analysis. These functions all use artificial intelligence to guess results that you would expect:

    • Use as.mo() to get an ID of a microorganism. The IDs are human readable for the trained eye - the ID of Klebsiella pneumoniae is “B_KLBSL_PNE” (B stands for Bacteria) and the ID of S. aureus is “B_STPHY_AUR”. The function takes almost any text as input that looks like the name or code of a microorganism like “E. coli”, “esco” or “esccol” and tries to find expected results using artificial intelligence (AI) on the included ITIS data set, consisting of almost 20,000 microorganisms. It is very fast, please see our benchmarks. Moreover, it can group Staphylococci into coagulase negative and positive (CoNS and CoPS, see source) and can categorise Streptococci into Lancefield groups (like beta-haemolytic Streptococcus Group B, source).
    • Use as.rsi() to transform values to valid antimicrobial results. It produces just S, I or R based on your input and warns about invalid values. Even values like “<=0.002; S” (combined MIC/RSI) will result in “S”.
    • @@ -295,8 +295,8 @@
  2. Use mdro() (abbreviation of Multi Drug Resistant Organisms) to check your isolates for exceptional resistance with country-specific guidelines or EUCAST rules. Currently, national guidelines for Germany and the Netherlands are supported.
  3. -
  4. The data set microorganisms contains the complete taxonomic tree of more than 18,000 microorganisms (bacteria, fungi/yeasts and protozoa). Furthermore, the colloquial name and Gram stain are available, which enables resistance analysis of e.g. different antibiotics per Gram stain. The package also contains functions to look up values in this data set like mo_genus(), mo_family(), mo_gramstain() or even mo_phylum(). As they use as.mo() internally, they also use artificial intelligence. For example, mo_genus("MRSA") and mo_genus("S. aureus") will both return "Staphylococcus". They also come with support for German, Dutch, Spanish, Italian, French and Portuguese. These functions can be used to add new variables to your data.
  5. -
  6. The data set antibiotics contains the ATC code, LIS codes, official name, trivial name and DDD of both oral and parenteral administration. It also contains a total of 298 trade names. Use functions like ab_name() and ab_tradenames() to look up values. The ab_* functions use as.atc() internally so they support AI to guess your expected result. For example, ab_name("Fluclox"), ab_name("Floxapen") and ab_name("J01CF05") will all return "Flucloxacillin". These functions can again be used to add new variables to your data.
  7. +
  8. The data set microorganisms contains the complete taxonomic tree of almost 20,000 microorganisms (bacteria, fungi/yeasts and protozoa). Furthermore, the colloquial name and Gram stain are available, which enables resistance analysis of e.g. different antibiotics per Gram stain. The package also contains functions to look up values in this data set like mo_genus(), mo_family(), mo_gramstain() or even mo_phylum(). As they use as.mo() internally, they also use artificial intelligence. For example, mo_genus("MRSA") and mo_genus("S. aureus") will both return "Staphylococcus". They also come with support for German, Dutch, Spanish, Italian, French and Portuguese. These functions can be used to add new variables to your data.
  9. +
  10. The data set antibiotics contains almost 500 antimicrobial drugs with their ATC code, EARS-Net code, common LIS codes, official name, trivial name and DDD of both oral and parenteral administration. It also contains hundreds of trade names. Use functions like atc_name() and atc_tradenames() to look up values. The atc_* functions use as.atc() internally so they support AI to guess your expected result. For example, atc_name("Fluclox"), atc_name("Floxapen") and atc_name("J01CF05") will all return "Flucloxacillin". These functions can again be used to add new variables to your data.
  11. @@ -312,8 +312,8 @@
  12. It teaches the user how to use all the above actions.

      -
    • The package contains extensive help pages with many examples.
    • -
    • It also contains an example data set called septic_patients. This data set contains: +
    • Aside from this website with many tutorials, the package itself contains extensive help pages with many examples for all functions.
    • +
    • It also contains an example data set called septic_patients. This data set contains:
      • 2,000 blood culture isolates from anonymised septic patients between 2001 and 2017 in the Northern Netherlands
      • Results of 40 antibiotics (each antibiotic in its own column) with a total of 38,414 antimicrobial results
      • diff --git a/docs/news/index.html b/docs/news/index.html index 5aebe7e9..748c90d7 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016
@@ -791,7 +791,7 @@ These functions use as.atc() diff --git a/docs/reference/ITIS.html b/docs/reference/ITIS.html index eb78b921..543f47bd 100644 --- a/docs/reference/ITIS.html +++ b/docs/reference/ITIS.html @@ -247,7 +247,7 @@ This package contains the complete microbial taxonomic data (wi


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

Examples

diff --git a/docs/reference/WHOCC.html b/docs/reference/WHOCC.html index dbfc998a..a7e5fac8 100644 --- a/docs/reference/WHOCC.html +++ b/docs/reference/WHOCC.html @@ -247,7 +247,7 @@ This package contains all ~500 antimicrobial drugs and their An


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

Examples

diff --git a/docs/reference/WHONET.html b/docs/reference/WHONET.html new file mode 100644 index 00000000..33ff4385 --- /dev/null +++ b/docs/reference/WHONET.html @@ -0,0 +1,322 @@ + + + + + + + + +Data set with 500 isolates - WHONET example — WHONET • AMR (for R) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ +
+
+ + +
+ +

This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The data itself was based on our septic_patients data set.

+ +
+ +
WHONET
+ +

Format

+ +

A data.frame with 500 observations and 53 variables:

+
Identification number

ID of the sample

+
Specimen number

ID of the specimen

+
Organism

Microorganisms, can be coerced with as.mo

+
Country

Country of origin

+
Laboratory

Name of laboratory

+
Last name

Last name of patient

+
First name

Initial of patient

+
Sex

Gender of patient

+
Age

Age of patient

+
Age category

Age group, can also be looked up using age_groups

+
Date of admission

Date of hospital admission

+
Specimen date

Date when specimen was received at laboratory

+
Specimen type

Specimen type or group

+
Specimen type (Numeric)

Translation of "Specimen type"

+
Reason

Reason of request with Differential Diagnosis

+
Isolate number

ID of isolate

+
Organism type

Type of microorganism, can also be looked up using mo_type

+
Serotype

Serotype of microorganism

+
Beta-lactamase

Microorganism produces beta-lactamase?

+
ESBL

Microorganism produces extended spectrum beta-lactamase?

+
Carbapenemase

Microorganism produces carbapenemase?

+
MRSA screening test

Microorganism is possible MRSA?

+
Inducible clindamycin resistance

Clindamycin can be induced?

+
Comment

Other comments

+
Date of data entry

Date this data was entered in WHONET

+
AMP_ND10:CIP_EE

27 different antibiotics. You can lookup the abbreviatons in the antibiotics data set, or use e.g. atc_name("AMP") to get the official name immediately.

+
+ +

Read more on our website!

+ + +


+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

+ + +
+ +
+ + +
+ + + + + + + + + diff --git a/docs/reference/abname.html b/docs/reference/abname.html index 421f4953..b8d53a1e 100644 --- a/docs/reference/abname.html +++ b/docs/reference/abname.html @@ -278,7 +278,7 @@ This package contains all ~500 antimicrobial drugs and their An


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

Examples

diff --git a/docs/reference/age.html b/docs/reference/age.html index 6e140656..bc55d469 100644 --- a/docs/reference/age.html +++ b/docs/reference/age.html @@ -257,7 +257,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

See also

diff --git a/docs/reference/age_groups.html b/docs/reference/age_groups.html index bc20fef6..a7767c4c 100644 --- a/docs/reference/age_groups.html +++ b/docs/reference/age_groups.html @@ -270,7 +270,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

See also

@@ -303,11 +303,11 @@ On our website https://msberends.gitla # resistance of ciprofloxacine per age group library(dplyr) septic_patients %>% - mutate(first_isolate = first_isolate(.)) %>% - filter(first_isolate == TRUE, + mutate(first_isolate = first_isolate(.)) %>% + filter(first_isolate == TRUE, mo == as.mo("E. coli")) %>% - group_by(age_group = age_groups(age)) %>% - select(age_group, + group_by(age_group = age_groups(age)) %>% + select(age_group, cipr) %>% ggplot_rsi(x = "age_group") # } diff --git a/docs/reference/antibiotics.html b/docs/reference/antibiotics.html index 77d4ed74..bac34218 100644 --- a/docs/reference/antibiotics.html +++ b/docs/reference/antibiotics.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 @@ -269,7 +269,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

See also

diff --git a/docs/reference/as.atc.html b/docs/reference/as.atc.html index 8afd2b4b..91fb5147 100644 --- a/docs/reference/as.atc.html +++ b/docs/reference/as.atc.html @@ -269,7 +269,7 @@ This package contains all ~500 antimicrobial drugs and their An


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

See also

diff --git a/docs/reference/as.mic.html b/docs/reference/as.mic.html index 2399bf5b..03e13b4b 100644 --- a/docs/reference/as.mic.html +++ b/docs/reference/as.mic.html @@ -259,7 +259,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

See also

diff --git a/docs/reference/as.mo.html b/docs/reference/as.mo.html index 413579be..436773f3 100644 --- a/docs/reference/as.mo.html +++ b/docs/reference/as.mo.html @@ -323,7 +323,7 @@ This package contains the complete microbial taxonomic data (wi


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

See also

@@ -371,16 +371,16 @@ The mo_property functions (like # the select function of tidyverse is also supported: library(dplyr) df$mo <- df %>% - select(microorganism_name) %>% + select(microorganism_name) %>% as.mo() # and can even contain 2 columns, which is convenient for genus/species combinations: df$mo <- df %>% - select(genus, species) %>% + select(genus, species) %>% as.mo() # although this works easier and does the same: df <- df %>% - mutate(mo = as.mo(paste(genus, species))) + mutate(mo = as.mo(paste(genus, species))) # } diff --git a/docs/reference/atc_property.html b/docs/reference/atc_property.html index 6e23c985..47eeb3e6 100644 --- a/docs/reference/atc_property.html +++ b/docs/reference/atc_property.html @@ -273,7 +273,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

See also

diff --git a/docs/reference/count.html b/docs/reference/count.html index eb8a7191..59587c14 100644 --- a/docs/reference/count.html +++ b/docs/reference/count.html @@ -289,14 +289,14 @@ count_R and count_IR can be used to count resistant isolates, count_S and count_

Details

These functions are meant to count isolates. Use the portion_* functions to calculate microbial resistance.

-

n_rsi is an alias of count_all. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to n_distinct. Their function is equal to count_S(...) + count_IR(...).

+

n_rsi is an alias of count_all. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to n_distinct. Their function is equal to count_S(...) + count_IR(...).

count_df takes any variable from data that has an "rsi" class (created with as.rsi) and counts the amounts of R, I and S. The resulting tidy data (see Source) data.frame will have three rows (S/I/R) and a column for each variable with class "rsi".

Read more on our website!


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

See also

@@ -328,13 +328,13 @@ On our website https://msberends.gitla library(dplyr) septic_patients %>% - group_by(hospital_id) %>% - summarise(R = count_R(cipr), + group_by(hospital_id) %>% + summarise(R = count_R(cipr), I = count_I(cipr), S = count_S(cipr), n1 = count_all(cipr), # the actual total; sum of all three n2 = n_rsi(cipr), # same - analogous to n_distinct - total = n()) # NOT the amount of tested isolates! + total = n()) # NOT the amount of tested isolates! # Count co-resistance between amoxicillin/clav acid and gentamicin, # so we can see that combination therapy does a lot more than mono therapy. @@ -352,13 +352,13 @@ On our website https://msberends.gitla # Get portions S/I/R immediately of all rsi columns septic_patients %>% - select(amox, cipr) %>% + select(amox, cipr) %>% count_df(translate = FALSE) # It also supports grouping variables septic_patients %>% - select(hospital_id, amox, cipr) %>% - group_by(hospital_id) %>% + select(hospital_id, amox, cipr) %>% + group_by(hospital_id) %>% count_df(translate = FALSE) # } diff --git a/docs/reference/eucast_rules.html b/docs/reference/eucast_rules.html index 74f6942a..0bb9f0c3 100644 --- a/docs/reference/eucast_rules.html +++ b/docs/reference/eucast_rules.html @@ -394,7 +394,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

Examples

diff --git a/docs/reference/first_isolate.html b/docs/reference/first_isolate.html index 8b7bd819..b403ddd1 100644 --- a/docs/reference/first_isolate.html +++ b/docs/reference/first_isolate.html @@ -360,7 +360,7 @@ To conduct an analysis of antimicrobial resistance, you should only include the


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

See also

@@ -375,11 +375,11 @@ On our website https://msberends.gitla library(dplyr) # Filter on first isolates: septic_patients %>% - mutate(first_isolate = first_isolate(., + mutate(first_isolate = first_isolate(., col_date = "date", col_patient_id = "patient_id", col_mo = "mo")) %>% - filter(first_isolate == TRUE) + filter(first_isolate == TRUE) # Which can be shortened to: septic_patients %>% @@ -390,14 +390,14 @@ On our website https://msberends.gitla # Now let's see if first isolates matter: A <- septic_patients %>% - group_by(hospital_id) %>% - summarise(count = n_rsi(gent), # gentamicin availability + group_by(hospital_id) %>% + summarise(count = n_rsi(gent), # gentamicin availability resistance = portion_IR(gent)) # gentamicin resistance B <- septic_patients %>% filter_first_weighted_isolate() %>% # the 1st isolate filter - group_by(hospital_id) %>% - summarise(count = n_rsi(gent), # gentamicin availability + group_by(hospital_id) %>% + summarise(count = n_rsi(gent), # gentamicin availability resistance = portion_IR(gent)) # gentamicin resistance # Have a look at A and B. diff --git a/docs/reference/freq.html b/docs/reference/freq.html index 290b346d..2b1966db 100644 --- a/docs/reference/freq.html +++ b/docs/reference/freq.html @@ -374,7 +374,7 @@ top_freq can be used to get the top/bottom n items of a frequency table, with co


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

Examples

@@ -392,8 +392,8 @@ On our website https://msberends.gitla # you could also use `select` or `pull` to get your variables septic_patients %>% - filter(hospital_id == "A") %>% - select(mo) %>% + filter(hospital_id == "A") %>% + select(mo) %>% freq() @@ -409,20 +409,20 @@ On our website https://msberends.gitla # group a variable and analyse another septic_patients %>% - group_by(hospital_id) %>% + group_by(hospital_id) %>% freq(gender) # get top 10 bugs of hospital A as a vector septic_patients %>% - filter(hospital_id == "A") %>% + filter(hospital_id == "A") %>% freq(mo) %>% top_freq(10) # save frequency table to an object years <- septic_patients %>% - mutate(year = format(date, "%Y")) %>% + mutate(year = format(date, "%Y")) %>% freq(year) @@ -473,11 +473,11 @@ On our website https://msberends.gitla # only get selected columns septic_patients %>% freq(hospital_id) %>% - select(item, percent) + select(item, percent) septic_patients %>% freq(hospital_id) %>% - select(-count, -cum_count) + select(-count, -cum_count) # check differences between frequency tables diff --git a/docs/reference/g.test.html b/docs/reference/g.test.html index 96901602..96f1e723 100644 --- a/docs/reference/g.test.html +++ b/docs/reference/g.test.html @@ -331,7 +331,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

References

diff --git a/docs/reference/get_locale.html b/docs/reference/get_locale.html index 4aca094a..2d65dcf7 100644 --- a/docs/reference/get_locale.html +++ b/docs/reference/get_locale.html @@ -249,7 +249,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

diff --git a/docs/reference/ggplot_rsi.html b/docs/reference/ggplot_rsi.html index 4e1b3b6f..6ff3dcbd 100644 --- a/docs/reference/ggplot_rsi.html +++ b/docs/reference/ggplot_rsi.html @@ -230,7 +230,7 @@
-

Use these functions to create bar plots for antimicrobial resistance analysis. All functions rely on internal ggplot functions.

+

Use these functions to create bar plots for antimicrobial resistance analysis. All functions rely on internal ggplot functions.

@@ -321,7 +321,7 @@

At default, the names of antibiotics will be shown on the plots using abname. This can be set with the option get_antibiotic_names (a logical value), so change it e.g. to FALSE with options(get_antibiotic_names = FALSE).

The functions
geom_rsi will take any variable from the data that has an rsi class (created with as.rsi) using fun (count_df at default, can also be portion_df) and will plot bars with the percentage R, I and S. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis.

-

facet_rsi creates 2d plots (at default based on S/I/R) using facet_wrap.

+

facet_rsi creates 2d plots (at default based on S/I/R) using facet_wrap.

scale_y_percent transforms the y axis to a 0 to 100% range using scale_continuous.

scale_rsi_colours sets colours to the bars: green for S, yellow for I and red for R, using scale_brewer.

theme_rsi is a ggplot theme with minimal distraction.

@@ -332,7 +332,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

Examples

@@ -341,12 +341,12 @@ On our website https://msberends.gitla library(ggplot2) # get antimicrobial results for drugs against a UTI: -ggplot(septic_patients %>% select(amox, nitr, fosf, trim, cipr)) + +ggplot(septic_patients %>% select(amox, nitr, fosf, trim, cipr)) + geom_rsi() # prettify the plot using some additional functions: df <- septic_patients[, c("amox", "nitr", "fosf", "trim", "cipr")] -ggplot(df) + +ggplot(df) + geom_rsi() + scale_y_percent() + scale_rsi_colours() + @@ -355,17 +355,17 @@ On our website https://msberends.gitla # or better yet, simplify this using the wrapper function - a single command: septic_patients %>% - select(amox, nitr, fosf, trim, cipr) %>% + select(amox, nitr, fosf, trim, cipr) %>% ggplot_rsi() # get only portions and no counts: septic_patients %>% - select(amox, nitr, fosf, trim, cipr) %>% + select(amox, nitr, fosf, trim, cipr) %>% ggplot_rsi(fun = portion_df) # add other ggplot2 parameters as you like: septic_patients %>% - select(amox, nitr, fosf, trim, cipr) %>% + select(amox, nitr, fosf, trim, cipr) %>% ggplot_rsi(width = 0.5, colour = "black", size = 1, @@ -374,56 +374,56 @@ On our website https://msberends.gitla # resistance of ciprofloxacine per age group septic_patients %>% - mutate(first_isolate = first_isolate(.)) %>% - filter(first_isolate == TRUE, + mutate(first_isolate = first_isolate(.)) %>% + filter(first_isolate == TRUE, mo == as.mo("E. coli")) %>% # `age_group` is also a function of this package: - group_by(age_group = age_groups(age)) %>% - select(age_group, + group_by(age_group = age_groups(age)) %>% + select(age_group, cipr) %>% ggplot_rsi(x = "age_group") # }# NOT RUN { # for colourblind mode, use divergent colours from the viridis package: septic_patients %>% - select(amox, nitr, fosf, trim, cipr) %>% - ggplot_rsi() + scale_fill_viridis_d() + select(amox, nitr, fosf, trim, cipr) %>% + ggplot_rsi() + scale_fill_viridis_d() # it also supports groups (don't forget to use the group var on `x` or `facet`): septic_patients %>% - select(hospital_id, amox, nitr, fosf, trim, cipr) %>% - group_by(hospital_id) %>% + select(hospital_id, amox, nitr, fosf, trim, cipr) %>% + group_by(hospital_id) %>% ggplot_rsi(x = hospital_id, facet = Antibiotic, nrow = 1) + - labs(title = "AMR of Anti-UTI Drugs Per Hospital", + labs(title = "AMR of Anti-UTI Drugs Per Hospital", x = "Hospital") # genuine analysis: check 2 most prevalent microorganisms septic_patients %>% # create new bacterial ID's, with all CoNS under the same group (Becker et al.) - mutate(mo = as.mo(mo, Becker = TRUE)) %>% + mutate(mo = as.mo(mo, Becker = TRUE)) %>% # filter on top three bacterial ID's - filter(mo %in% top_freq(freq(.$mo), 3)) %>% + filter(mo %in% top_freq(freq(.$mo), 3)) %>% # determine first isolates - mutate(first_isolate = first_isolate(., + mutate(first_isolate = first_isolate(., col_date = "date", col_patient_id = "patient_id", col_mo = "mo")) %>% # filter on first isolates - filter(first_isolate == TRUE) %>% + filter(first_isolate == TRUE) %>% # get short MO names (like "E. coli") - mutate(mo = mo_shortname(mo, Becker = TRUE)) %>% + mutate(mo = mo_shortname(mo, Becker = TRUE)) %>% # select this short name and some antiseptic drugs - select(mo, cfur, gent, cipr) %>% + select(mo, cfur, gent, cipr) %>% # group by MO - group_by(mo) %>% + group_by(mo) %>% # plot the thing, putting MOs on the facet ggplot_rsi(x = Antibiotic, facet = mo, translate_ab = FALSE, nrow = 1) + - labs(title = "AMR of Top Three Microorganisms In Blood Culture Isolates", + labs(title = "AMR of Top Three Microorganisms In Blood Culture Isolates", subtitle = "Only First Isolates, CoNS grouped according to Becker et al. (2014)", x = "Microorganisms") # } diff --git a/docs/reference/guess_ab_col.html b/docs/reference/guess_ab_col.html index 0360d4d8..5f519a67 100644 --- a/docs/reference/guess_ab_col.html +++ b/docs/reference/guess_ab_col.html @@ -257,7 +257,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

Examples

diff --git a/docs/reference/index.html b/docs/reference/index.html index a3285f40..5346df95 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -78,7 +78,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 @@ -477,6 +477,12 @@

Data set with 2,000 blood culture isolates from septic patients

+ +

WHONET

+ +

Data set with 500 isolates - WHONET example

+ +

microorganisms.codes

diff --git a/docs/reference/join.html b/docs/reference/join.html index 6802a717..a4d13982 100644 --- a/docs/reference/join.html +++ b/docs/reference/join.html @@ -275,7 +275,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

Examples

diff --git a/docs/reference/key_antibiotics.html b/docs/reference/key_antibiotics.html index c98f85b8..e4f0c6f2 100644 --- a/docs/reference/key_antibiotics.html +++ b/docs/reference/key_antibiotics.html @@ -327,7 +327,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

See also

@@ -341,8 +341,8 @@ On our website https://msberends.gitla library(dplyr) # set key antibiotics to a new variable my_patients <- septic_patients %>% - mutate(keyab = key_antibiotics(.)) %>% - mutate( + mutate(keyab = key_antibiotics(.)) %>% + mutate( # now calculate first isolates first_regular = first_isolate(., col_keyantibiotics = FALSE), # and first WEIGHTED isolates diff --git a/docs/reference/kurtosis.html b/docs/reference/kurtosis.html index 42bfb4b3..ebee3401 100644 --- a/docs/reference/kurtosis.html +++ b/docs/reference/kurtosis.html @@ -262,7 +262,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

See also

diff --git a/docs/reference/like.html b/docs/reference/like.html index 33faca7e..aca4cbce 100644 --- a/docs/reference/like.html +++ b/docs/reference/like.html @@ -275,7 +275,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

See also

@@ -302,7 +302,7 @@ On our website https://msberends.gitla library(dplyr) septic_patients %>% left_join_microorganisms() %>% - filter(genus %like% '^ent') %>% + filter(genus %like% '^ent') %>% freq(genus, species) # } diff --git a/docs/reference/mdro.html b/docs/reference/mdro.html index a80d314f..5dbd3d83 100644 --- a/docs/reference/mdro.html +++ b/docs/reference/mdro.html @@ -617,7 +617,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

Examples

@@ -625,7 +625,7 @@ On our website https://msberends.gitla library(dplyr) septic_patients %>% - mutate(EUCAST = mdro(.), + mutate(EUCAST = mdro(.), BRMO = brmo(.)) # } diff --git a/docs/reference/microorganisms.codes.html b/docs/reference/microorganisms.codes.html index 8e5b080d..e374d5a4 100644 --- a/docs/reference/microorganisms.codes.html +++ b/docs/reference/microorganisms.codes.html @@ -247,7 +247,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

See also

diff --git a/docs/reference/microorganisms.html b/docs/reference/microorganisms.html index 70aa7c6a..84360f30 100644 --- a/docs/reference/microorganisms.html +++ b/docs/reference/microorganisms.html @@ -272,7 +272,7 @@ This package contains the complete microbial taxonomic data (wi


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

See also

diff --git a/docs/reference/microorganisms.old.html b/docs/reference/microorganisms.old.html index 5d8d67e9..142952cc 100644 --- a/docs/reference/microorganisms.old.html +++ b/docs/reference/microorganisms.old.html @@ -261,7 +261,7 @@ This package contains the complete microbial taxonomic data (wi


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

See also

diff --git a/docs/reference/mo_property.html b/docs/reference/mo_property.html index eb9a3a04..65dc3584 100644 --- a/docs/reference/mo_property.html +++ b/docs/reference/mo_property.html @@ -335,7 +335,7 @@ This package contains the complete microbial taxonomic data (wi


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

See also

diff --git a/docs/reference/mo_source.html b/docs/reference/mo_source.html index 212176ec..bc0b9367 100644 --- a/docs/reference/mo_source.html +++ b/docs/reference/mo_source.html @@ -258,7 +258,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

Examples

diff --git a/docs/reference/p.symbol.html b/docs/reference/p.symbol.html index 41d0a2f5..7341b462 100644 --- a/docs/reference/p.symbol.html +++ b/docs/reference/p.symbol.html @@ -257,7 +257,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

diff --git a/docs/reference/portion.html b/docs/reference/portion.html index 6af32f61..db801e51 100644 --- a/docs/reference/portion.html +++ b/docs/reference/portion.html @@ -319,7 +319,7 @@ portion_R and portion_IR can be used to calculate resistance, portion_S and port


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

See also

@@ -347,17 +347,17 @@ On our website https://msberends.gitla septic_patients %>% portion_SI(amox) septic_patients %>% - group_by(hospital_id) %>% - summarise(p = portion_S(cipr), + group_by(hospital_id) %>% + summarise(p = portion_S(cipr), n = n_rsi(cipr)) # n_rsi works like n_distinct in dplyr septic_patients %>% - group_by(hospital_id) %>% - summarise(R = portion_R(cipr, as_percent = TRUE), + group_by(hospital_id) %>% + summarise(R = portion_R(cipr, as_percent = TRUE), I = portion_I(cipr, as_percent = TRUE), S = portion_S(cipr, as_percent = TRUE), n = n_rsi(cipr), # works like n_distinct in dplyr - total = n()) # NOT the amount of tested isolates! + total = n()) # NOT the amount of tested isolates! # Calculate co-resistance between amoxicillin/clav acid and gentamicin, # so we can see that combination therapy does a lot more than mono therapy: @@ -372,8 +372,8 @@ On our website https://msberends.gitla septic_patients %>% - group_by(hospital_id) %>% - summarise(cipro_p = portion_S(cipr, as_percent = TRUE), + group_by(hospital_id) %>% + summarise(cipro_p = portion_S(cipr, as_percent = TRUE), cipro_n = count_all(cipr), genta_p = portion_S(gent, as_percent = TRUE), genta_n = count_all(gent), @@ -382,22 +382,22 @@ On our website https://msberends.gitla # Get portions S/I/R immediately of all rsi columns septic_patients %>% - select(amox, cipr) %>% + select(amox, cipr) %>% portion_df(translate = FALSE) # It also supports grouping variables septic_patients %>% - select(hospital_id, amox, cipr) %>% - group_by(hospital_id) %>% + select(hospital_id, amox, cipr) %>% + group_by(hospital_id) %>% portion_df(translate = FALSE) # }# NOT RUN { # calculate current empiric combination therapy of Helicobacter gastritis: my_table %>% - filter(first_isolate == TRUE, + filter(first_isolate == TRUE, genus == "Helicobacter") %>% - summarise(p = portion_S(amox, metr), # amoxicillin with metronidazole + summarise(p = portion_S(amox, metr), # amoxicillin with metronidazole n = count_all(amox, metr)) # } diff --git a/docs/reference/read.4D.html b/docs/reference/read.4D.html index 3577e8c1..cb952277 100644 --- a/docs/reference/read.4D.html +++ b/docs/reference/read.4D.html @@ -382,7 +382,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

diff --git a/docs/reference/resistance_predict.html b/docs/reference/resistance_predict.html index e10488df..663d4586 100644 --- a/docs/reference/resistance_predict.html +++ b/docs/reference/resistance_predict.html @@ -331,7 +331,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

See also

@@ -348,7 +348,7 @@ On our website https://msberends.gitla library(dplyr) x <- septic_patients %>% filter_first_isolate() %>% - filter(mo_genus(mo) == "Staphylococcus") %>% + filter(mo_genus(mo) == "Staphylococcus") %>% resistance_predict("peni") plot(x) @@ -357,27 +357,27 @@ On our website https://msberends.gitla if (!require(ggplot2)) { data <- septic_patients %>% - filter(mo == as.mo("E. coli")) %>% + filter(mo == as.mo("E. coli")) %>% resistance_predict(col_ab = "amox", col_date = "date", info = FALSE, minimum = 15) - ggplot(data, - aes(x = year)) + - geom_col(aes(y = value), + ggplot(data, + aes(x = year)) + + geom_col(aes(y = value), fill = "grey75") + - geom_errorbar(aes(ymin = se_min, + geom_errorbar(aes(ymin = se_min, ymax = se_max), colour = "grey50") + - scale_y_continuous(limits = c(0, 1), + scale_y_continuous(limits = c(0, 1), breaks = seq(0, 1, 0.1), labels = paste0(seq(0, 100, 10), "%")) + - labs(title = expression(paste("Forecast of amoxicillin resistance in ", + labs(title = expression(paste("Forecast of amoxicillin resistance in ", italic("E. coli"))), y = "%IR", x = "Year") + - theme_minimal(base_size = 13) + theme_minimal(base_size = 13) } # } diff --git a/docs/reference/septic_patients.html b/docs/reference/septic_patients.html index c9bd5059..02b912a1 100644 --- a/docs/reference/septic_patients.html +++ b/docs/reference/septic_patients.html @@ -255,7 +255,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

diff --git a/docs/reference/skewness.html b/docs/reference/skewness.html index 0a2623aa..70fa067b 100644 --- a/docs/reference/skewness.html +++ b/docs/reference/skewness.html @@ -264,7 +264,7 @@ When negative: the left tail is longer; the mass of the distribution is concentr


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

See also

diff --git a/docs/reference/supplementary_data.html b/docs/reference/supplementary_data.html index 66bdb5c8..410879cf 100644 --- a/docs/reference/supplementary_data.html +++ b/docs/reference/supplementary_data.html @@ -250,7 +250,7 @@


-On our website https://msberends.gitlab.io/AMR you can find a omprehensive tutorial about how to conduct AMR analysis and find the complete documentation of all functions, which reads a lot easier than in R.

+On our website https://msberends.gitlab.io/AMR you can find a comprehensive tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.

diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 0ce9b9e7..4c2c3537 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -15,6 +15,9 @@ https://msberends.gitlab.io/AMR/reference/WHOCC.html + + https://msberends.gitlab.io/AMR/reference/WHONET.html + https://msberends.gitlab.io/AMR/reference/abname.html diff --git a/index.md b/index.md index 19d86e95..ea0434a3 100644 --- a/index.md +++ b/index.md @@ -7,7 +7,7 @@ `AMR` is a free and open-source [R package](https://www.r-project.org) to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods. It supports any table format, including WHONET/EARS-Net data. We created this package for both academic research and routine analysis at the Faculty of Medical Sciences of the University of Groningen and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). -This R package is actively maintained and free software; you can freely use and distribute it for both personal and commercial (but **not** patent) purposes under the terms of the GNU General Public Licence version 2.0 (GPL-2), as published by the Free Software Foundation. Read the full licence [here](./LICENSE-text.html). +This R package is actively maintained and free software; you can freely use and distribute it for both personal and commercial (but **not** patent) purposes under the terms of the GNU General Public License version 2.0 (GPL-2), as published by the Free Software Foundation. Read the full license [here](./LICENSE-text.html). This package can be used for: @@ -18,7 +18,7 @@ This package can be used for: * Plotting antimicrobial resistance * Determining first isolates to be used for AMR analysis * Applying EUCAST rules - * Determining multi-drug resistance organisms (MDRO) + * Determining multi-drug resistant organisms (MDRO) * Descriptive statistics: frequency tables, kurtosis and skewness This package is ready-to-use for a professional environment by specialists in the following fields: @@ -75,7 +75,7 @@ To find out how to conduct AMR analysis, please [continue reading here to get st -We support data (exported files) from WHONET. The `AMR` package contains a data set `antibiotics` which also contains all EARS-Net antibiotic abbreviations. Furthermore, when using WHONET data as input for analysis all input parameters will be set automatically. +We support WHONET and EARS-Net data. Exported files from WHONET can be imported into R and can be analysed easily using this package. For education purposes, we created an [example data set `WHONET`](./reference/WHONET.html) with the exact same structure and a WHONET export file. Furthermore, this package also contains a [data set `antibiotics`](./reference/antibiotics.html) with all EARS-Net antibiotic abbreviations. When using WHONET data as input for analysis, all input parameters will be set automatically. Read our tutorial about [how to work with WHONET data here](./articles/WHONET.html). @@ -101,7 +101,7 @@ Read more about the data from ITIS [in our manual](./reference/ITIS.html). The `AMR` package basically does four important things: -1. It **cleanses existing data**, by transforming it to reproducible and profound *classes*, making the most efficient use of R. These functions all use artificial intelligence to guess results that you would expect: +1. It **cleanses existing data** by providing new *classes* for microoganisms, antibiotics and antimicrobial results (both S/I/R and MIC). With this package, you learn R everything about microbiology that is needed for analysis. These functions all use artificial intelligence to guess results that you would expect: * Use `as.mo()` to get an ID of a microorganism. The IDs are human readable for the trained eye - the ID of *Klebsiella pneumoniae* is "B_KLBSL_PNE" (B stands for Bacteria) and the ID of *S. aureus* is "B_STPHY_AUR". The function takes almost any text as input that looks like the name or code of a microorganism like "E. coli", "esco" or "esccol" and tries to find expected results using artificial intelligence (AI) on the included ITIS data set, consisting of almost 20,000 microorganisms. It is *very* fast, please see our [benchmarks](./articles/benchmarks.html). Moreover, it can group *Staphylococci* into coagulase negative and positive (CoNS and CoPS, see [source](./reference/as.mo.html#source)) and can categorise *Streptococci* into Lancefield groups (like beta-haemolytic *Streptococcus* Group B, [source](./reference/as.mo.html#source)). * Use `as.rsi()` to transform values to valid antimicrobial results. It produces just S, I or R based on your input and warns about invalid values. Even values like "<=0.002; S" (combined MIC/RSI) will result in "S". @@ -114,8 +114,8 @@ The `AMR` package basically does four important things: * Use `first_isolate()` to identify the first isolates of every patient [using guidelines from the CLSI](https://clsi.org/standards/products/microbiology/documents/m39/) (Clinical and Laboratory Standards Institute). * You can also identify first *weighted* isolates of every patient, an adjusted version of the CLSI guideline. This takes into account key antibiotics of every strain and compares them. * Use `mdro()` (abbreviation of Multi Drug Resistant Organisms) to check your isolates for exceptional resistance with country-specific guidelines or EUCAST rules. Currently, national guidelines for Germany and the Netherlands are supported. - * The data set `microorganisms` contains the complete taxonomic tree of more than 18,000 microorganisms (bacteria, fungi/yeasts and protozoa). Furthermore, the colloquial name and Gram stain are available, which enables resistance analysis of e.g. different antibiotics per Gram stain. The package also contains functions to look up values in this data set like `mo_genus()`, `mo_family()`, `mo_gramstain()` or even `mo_phylum()`. As they use `as.mo()` internally, they also use artificial intelligence. For example, `mo_genus("MRSA")` and `mo_genus("S. aureus")` will both return `"Staphylococcus"`. They also come with support for German, Dutch, Spanish, Italian, French and Portuguese. These functions can be used to add new variables to your data. - * The data set `antibiotics` contains the ATC code, LIS codes, official name, trivial name and DDD of both oral and parenteral administration. It also contains a total of 298 trade names. Use functions like `ab_name()` and `ab_tradenames()` to look up values. The `ab_*` functions use `as.atc()` internally so they support AI to guess your expected result. For example, `ab_name("Fluclox")`, `ab_name("Floxapen")` and `ab_name("J01CF05")` will all return `"Flucloxacillin"`. These functions can again be used to add new variables to your data. + * The [data set `microorganisms`](./reference/microorganisms.html) contains the complete taxonomic tree of almost 20,000 microorganisms (bacteria, fungi/yeasts and protozoa). Furthermore, the colloquial name and Gram stain are available, which enables resistance analysis of e.g. different antibiotics per Gram stain. The package also contains functions to look up values in this data set like `mo_genus()`, `mo_family()`, `mo_gramstain()` or even `mo_phylum()`. As they use `as.mo()` internally, they also use artificial intelligence. For example, `mo_genus("MRSA")` and `mo_genus("S. aureus")` will both return `"Staphylococcus"`. They also come with support for German, Dutch, Spanish, Italian, French and Portuguese. These functions can be used to add new variables to your data. + * The [data set `antibiotics`](./reference/antibiotics.html) contains almost 500 antimicrobial drugs with their ATC code, EARS-Net code, common LIS codes, official name, trivial name and DDD of both oral and parenteral administration. It also contains hundreds of trade names. Use functions like `atc_name()` and `atc_tradenames()` to look up values. The `atc_*` functions use `as.atc()` internally so they support AI to guess your expected result. For example, `atc_name("Fluclox")`, `atc_name("Floxapen")` and `atc_name("J01CF05")` will all return `"Flucloxacillin"`. These functions can again be used to add new variables to your data. 3. It **analyses the data** with convenient functions that use well-known methods. @@ -126,8 +126,8 @@ The `AMR` package basically does four important things: 4. It **teaches the user** how to use all the above actions. - * The package contains extensive help pages with many examples. - * It also contains an example data set called `septic_patients`. This data set contains: + * Aside from this website with many tutorials, the package itself contains extensive help pages with many examples for all functions. + * It also contains an [example data set called `septic_patients`](.reference/septic_patients.html). This data set contains: * 2,000 blood culture isolates from anonymised septic patients between 2001 and 2017 in the Northern Netherlands * Results of 40 antibiotics (each antibiotic in its own column) with a total of 38,414 antimicrobial results * Real and genuine data diff --git a/man/AMR-deprecated.Rd b/man/AMR-deprecated.Rd index 032b7f6e..7b1d433b 100644 --- a/man/AMR-deprecated.Rd +++ b/man/AMR-deprecated.Rd @@ -49,7 +49,7 @@ These functions are so-called '\link{Deprecated}'. They will be removed in a fut \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \keyword{internal} diff --git a/man/AMR.Rd b/man/AMR.Rd index 38471a41..fefe4e95 100644 --- a/man/AMR.Rd +++ b/man/AMR.Rd @@ -4,19 +4,26 @@ \alias{AMR} \title{The \code{AMR} Package} \description{ -Welcome to the \code{AMR} package. This page gives some additional contact information about the authors. +Welcome to the \code{AMR} package. } \details{ -This package was intended to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods. +\code{AMR} is a free and open-source R package to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods. It supports any table format, including WHONET/EARS-Net data. -This package was created for both academic research and routine analysis by PhD students of the Faculty of Medical Sciences of the University of Groningen and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). +We created this package for both academic research and routine analysis at the Faculty of Medical Sciences of the University of Groningen and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). This R package is actively maintained and free software; you can freely use and distribute it for both personal and commercial (but not patent) purposes under the terms of the GNU General Public License version 2.0 (GPL-2), as published by the Free Software Foundation. + +This package can be used for: +\itemize{ + \item{Calculating antimicrobial resistance} + \item{Predicting antimicrobial resistance using regression models} + \item{Getting properties for any microorganism (like Gram stain, species, genus or family)} + \item{Getting properties for any antibiotic (like name, ATC code, defined daily dose or trade name)} + \item{Plotting antimicrobial resistance} + \item{Determining first isolates to be used for AMR analysis} + \item{Applying EUCAST rules} + \item{Determining multi-drug resistance organisms (MDRO)} + \item{Descriptive statistics: frequency tables, kurtosis and skewness} } -\section{Read more on our website!}{ - -\if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. } - \section{Authors}{ Matthijs S. Berends[1,2] Christian F. Luz[1], Erwin E.A. Hassing[2], Corinna Glasner[1], Alex W. Friedrich[1], Bhanu N.M. Sinha[1] \cr @@ -25,6 +32,12 @@ Matthijs S. Berends[1,2] Christian F. Luz[1], Erwin E.A. Hassing[2], Corinna Gl [2] Certe Medical Diagnostics & Advice, Groningen, the Netherlands - \url{certe.nl} } +\section{Read more on our website!}{ + +\if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. +} + \section{Contact us}{ For suggestions, comments or questions, please contact us at: diff --git a/man/ITIS.Rd b/man/ITIS.Rd index a2e7baf8..c9b9bcb3 100644 --- a/man/ITIS.Rd +++ b/man/ITIS.Rd @@ -19,7 +19,7 @@ ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic spec \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/WHOCC.Rd b/man/WHOCC.Rd index 2134d791..4be99fd9 100644 --- a/man/WHOCC.Rd +++ b/man/WHOCC.Rd @@ -19,7 +19,7 @@ The WHOCC is located in Oslo at the Norwegian Institute of Public Health and fun \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/WHONET.Rd b/man/WHONET.Rd new file mode 100644 index 00000000..6ab8ad3f --- /dev/null +++ b/man/WHONET.Rd @@ -0,0 +1,48 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{WHONET} +\alias{WHONET} +\title{Data set with 500 isolates - WHONET example} +\format{A \code{\link{data.frame}} with 500 observations and 53 variables: +\describe{ + \item{\code{Identification number}}{ID of the sample} + \item{\code{Specimen number}}{ID of the specimen} + \item{\code{Organism}}{Microorganisms, can be coerced with \code{\link{as.mo}}} + \item{\code{Country}}{Country of origin} + \item{\code{Laboratory}}{Name of laboratory} + \item{\code{Last name}}{Last name of patient} + \item{\code{First name}}{Initial of patient} + \item{\code{Sex}}{Gender of patient} + \item{\code{Age}}{Age of patient} + \item{\code{Age category}}{Age group, can also be looked up using \code{\link{age_groups}}} + \item{\code{Date of admission}}{Date of hospital admission} + \item{\code{Specimen date}}{Date when specimen was received at laboratory} + \item{\code{Specimen type}}{Specimen type or group} + \item{\code{Specimen type (Numeric)}}{Translation of \code{"Specimen type"}} + \item{\code{Reason}}{Reason of request with Differential Diagnosis} + \item{\code{Isolate number}}{ID of isolate} + \item{\code{Organism type}}{Type of microorganism, can also be looked up using \code{\link{mo_type}}} + \item{\code{Serotype}}{Serotype of microorganism} + \item{\code{Beta-lactamase}}{Microorganism produces beta-lactamase?} + \item{\code{ESBL}}{Microorganism produces extended spectrum beta-lactamase?} + \item{\code{Carbapenemase}}{Microorganism produces carbapenemase?} + \item{\code{MRSA screening test}}{Microorganism is possible MRSA?} + \item{\code{Inducible clindamycin resistance}}{Clindamycin can be induced?} + \item{\code{Comment}}{Other comments} + \item{\code{Date of data entry}}{Date this data was entered in WHONET} + \item{\code{AMP_ND10:CIP_EE}}{27 different antibiotics. You can lookup the abbreviatons in the \code{\link{antibiotics}} data set, or use e.g. \code{\link{atc_name}("AMP")} to get the official name immediately.} +}} +\usage{ +WHONET +} +\description{ +This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The data itself was based on our \code{\link{septic_patients}} data set. +} +\section{Read more on our website!}{ + +\if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. +} + +\keyword{datasets} diff --git a/man/abname.Rd b/man/abname.Rd index a61904c8..f2922eaa 100644 --- a/man/abname.Rd +++ b/man/abname.Rd @@ -38,7 +38,7 @@ The WHOCC is located in Oslo at the Norwegian Institute of Public Health and fun \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/age.Rd b/man/age.Rd index a332bc80..e2918fd3 100644 --- a/man/age.Rd +++ b/man/age.Rd @@ -20,7 +20,7 @@ Calculates age in years based on a reference date, which is the sytem date at de \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/age_groups.Rd b/man/age_groups.Rd index 96cfd279..7497c0de 100644 --- a/man/age_groups.Rd +++ b/man/age_groups.Rd @@ -34,7 +34,7 @@ To split ages, the input can be: \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/antibiotics.Rd b/man/antibiotics.Rd index a3d2092c..a41d4e70 100644 --- a/man/antibiotics.Rd +++ b/man/antibiotics.Rd @@ -25,7 +25,7 @@ \item{\code{useful_grampositive}}{\code{FALSE} if not useful according to EUCAST, \code{NA} otherwise (see Source)} }} \source{ -- World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: \url{https://www.whocc.no/atc_ddd_index/} +World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: \url{https://www.whocc.no/atc_ddd_index/} Table antibiotic coding EARSS (from WHONET 5.3): \url{http://www.madsonline.dk/Tutorials/landskoder_antibiotika_WM.pdf} @@ -39,10 +39,20 @@ antibiotics \description{ A data set containing all antibiotics with a J0 code and some other antimicrobial agents, with their DDDs. Except for trade names and abbreviations, all properties were downloaded from the WHO, see Source. } +\section{WHOCC}{ + +\if{html}{\figure{logo_who.png}{options: height=60px style=margin-bottom:5px} \cr} +This package contains \strong{all ~500 antimicrobial drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}). + +These have become the gold standard for international drug utilisation monitoring and research. + +The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest. +} + \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \seealso{ diff --git a/man/as.atc.Rd b/man/as.atc.Rd index e3d1ceab..040c6451 100644 --- a/man/as.atc.Rd +++ b/man/as.atc.Rd @@ -38,7 +38,7 @@ The WHOCC is located in Oslo at the Norwegian Institute of Public Health and fun \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/as.mic.Rd b/man/as.mic.Rd index bea513d9..39dc9680 100755 --- a/man/as.mic.Rd +++ b/man/as.mic.Rd @@ -23,7 +23,7 @@ This transforms a vector to a new class \code{mic}, which is an ordered factor w \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/as.mo.Rd b/man/as.mo.Rd index 10f10f9f..a4e247bd 100644 --- a/man/as.mo.Rd +++ b/man/as.mo.Rd @@ -96,7 +96,7 @@ ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic spec \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/as.rsi.Rd b/man/as.rsi.Rd index 158b3a6a..d51dbde0 100755 --- a/man/as.rsi.Rd +++ b/man/as.rsi.Rd @@ -27,7 +27,7 @@ The function \code{is.rsi.eligible} returns \code{TRUE} when a columns contains \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/atc_property.Rd b/man/atc_property.Rd index 1edac996..2dd7bd76 100755 --- a/man/atc_property.Rd +++ b/man/atc_property.Rd @@ -40,7 +40,7 @@ Use these functions to return a specific property of an antibiotic from the \cod \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/count.Rd b/man/count.Rd index 46cfce6c..85e9e0ce 100644 --- a/man/count.Rd +++ b/man/count.Rd @@ -61,7 +61,7 @@ These functions are meant to count isolates. Use the \code{\link{portion}_*} fun \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/eucast_rules.Rd b/man/eucast_rules.Rd index 9460fdef..f5624dba 100644 --- a/man/eucast_rules.Rd +++ b/man/eucast_rules.Rd @@ -156,7 +156,7 @@ Abbrevations of the column containing antibiotics in the form: \strong{abbreviat \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/first_isolate.Rd b/man/first_isolate.Rd index e8a305a0..1b0072e8 100755 --- a/man/first_isolate.Rd +++ b/man/first_isolate.Rd @@ -99,7 +99,7 @@ The function \code{filter_first_weighted_isolate} is essentially equal to: \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/freq.Rd b/man/freq.Rd index da2873e1..a43f8ac7 100755 --- a/man/freq.Rd +++ b/man/freq.Rd @@ -110,7 +110,7 @@ The function \code{top_freq} uses \code{\link[dplyr]{top_n}} internally and will \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/g.test.Rd b/man/g.test.Rd index be5ec92d..7fea4d71 100644 --- a/man/g.test.Rd +++ b/man/g.test.Rd @@ -103,7 +103,7 @@ If there are more than two categories and you want to find out which ones are si \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/get_locale.Rd b/man/get_locale.Rd index 457c9dbd..cd93c2f9 100644 --- a/man/get_locale.Rd +++ b/man/get_locale.Rd @@ -20,6 +20,6 @@ Supported languages are \code{"en"} (English), \code{"de"} (German), \code{"nl"} \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } diff --git a/man/ggplot_rsi.Rd b/man/ggplot_rsi.Rd index 5ac5bc75..cb480b0f 100644 --- a/man/ggplot_rsi.Rd +++ b/man/ggplot_rsi.Rd @@ -84,7 +84,7 @@ At default, the names of antibiotics will be shown on the plots using \code{\lin \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/guess_ab_col.Rd b/man/guess_ab_col.Rd index 26627157..a4eb521f 100644 --- a/man/guess_ab_col.Rd +++ b/man/guess_ab_col.Rd @@ -19,7 +19,7 @@ This tries to find a column name in a data set based on information from the \co \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/join.Rd b/man/join.Rd index f7c6548c..18fa8a6d 100755 --- a/man/join.Rd +++ b/man/join.Rd @@ -41,7 +41,7 @@ Join the dataset \code{\link{microorganisms}} easily to an existing table or cha \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/key_antibiotics.Rd b/man/key_antibiotics.Rd index cc4afe6c..4515cb26 100755 --- a/man/key_antibiotics.Rd +++ b/man/key_antibiotics.Rd @@ -77,7 +77,7 @@ The function \code{key_antibiotics} returns a character vector with 12 antibioti \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/kurtosis.Rd b/man/kurtosis.Rd index 9c9c38ea..dd657b44 100644 --- a/man/kurtosis.Rd +++ b/man/kurtosis.Rd @@ -26,7 +26,7 @@ Kurtosis is a measure of the "tailedness" of the probability distribution of a r \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \seealso{ diff --git a/man/like.Rd b/man/like.Rd index 8db2d04a..08c17cbb 100755 --- a/man/like.Rd +++ b/man/like.Rd @@ -37,7 +37,7 @@ Using RStudio? This function can also be inserted from the Addins menu and can h \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/mdro.Rd b/man/mdro.Rd index b3220d30..48314bdc 100644 --- a/man/mdro.Rd +++ b/man/mdro.Rd @@ -258,7 +258,7 @@ Abbrevations of the column containing antibiotics in the form: \strong{abbreviat \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/microorganisms.Rd b/man/microorganisms.Rd index 40e61b16..06d8d24f 100755 --- a/man/microorganisms.Rd +++ b/man/microorganisms.Rd @@ -44,7 +44,7 @@ ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic spec \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \seealso{ diff --git a/man/microorganisms.codes.Rd b/man/microorganisms.codes.Rd index ce516570..2ffa6c4e 100644 --- a/man/microorganisms.codes.Rd +++ b/man/microorganisms.codes.Rd @@ -18,7 +18,7 @@ A data set containing commonly used codes for microorganisms. Define your own wi \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \seealso{ diff --git a/man/microorganisms.old.Rd b/man/microorganisms.old.Rd index ff5bde68..e67579a2 100644 --- a/man/microorganisms.old.Rd +++ b/man/microorganisms.old.Rd @@ -33,7 +33,7 @@ ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic spec \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \seealso{ diff --git a/man/mo_property.Rd b/man/mo_property.Rd index 4d3a63d9..42cd46cc 100644 --- a/man/mo_property.Rd +++ b/man/mo_property.Rd @@ -114,7 +114,7 @@ ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic spec \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/mo_source.Rd b/man/mo_source.Rd index a0a20dea..38c7324b 100644 --- a/man/mo_source.Rd +++ b/man/mo_source.Rd @@ -28,7 +28,7 @@ Reading an Excel file (\code{.xlsx}) with only one row has a size of 8-9 kB. The \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/p.symbol.Rd b/man/p.symbol.Rd index b3bda736..e2beb2e2 100644 --- a/man/p.symbol.Rd +++ b/man/p.symbol.Rd @@ -20,6 +20,6 @@ Return the symbol related to the p value: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0 \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } diff --git a/man/portion.Rd b/man/portion.Rd index 82a1422f..51a1bf90 100644 --- a/man/portion.Rd +++ b/man/portion.Rd @@ -82,7 +82,7 @@ The old \code{\link{rsi}} function is still available for backwards compatibilit \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/read.4D.Rd b/man/read.4D.Rd index 70e80964..456e297a 100644 --- a/man/read.4D.Rd +++ b/man/read.4D.Rd @@ -125,6 +125,6 @@ Column names will be transformed, but the original column names are set as a "la \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } diff --git a/man/resistance_predict.Rd b/man/resistance_predict.Rd index c1e16737..46dde885 100644 --- a/man/resistance_predict.Rd +++ b/man/resistance_predict.Rd @@ -72,7 +72,7 @@ Create a prediction model to predict antimicrobial resistance for the next years \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \examples{ diff --git a/man/septic_patients.Rd b/man/septic_patients.Rd index 96393e53..feb248a8 100755 --- a/man/septic_patients.Rd +++ b/man/septic_patients.Rd @@ -26,7 +26,7 @@ An anonymised data set containing 2,000 microbial blood culture isolates with th \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \keyword{datasets} diff --git a/man/skewness.Rd b/man/skewness.Rd index 0af0af49..509a5631 100644 --- a/man/skewness.Rd +++ b/man/skewness.Rd @@ -28,7 +28,7 @@ When negative: the left tail is longer; the mass of the distribution is concentr \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \seealso{ diff --git a/man/supplementary_data.Rd b/man/supplementary_data.Rd index 9fcbfbe8..b48d9396 100644 --- a/man/supplementary_data.Rd +++ b/man/supplementary_data.Rd @@ -24,7 +24,7 @@ These \code{\link{data.table}s} are transformed from the \code{\link{microorgani \section{Read more on our website!}{ \if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr} -On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a omprehensive tutorial} about how to conduct AMR analysis and find \href{https://msberends.gitlab.io/AMR/reference}{the complete documentation of all functions}, which reads a lot easier than in R. +On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. } \keyword{datasets} diff --git a/vignettes/WHONET.Rmd b/vignettes/WHONET.Rmd index 35b0776a..63c76083 100644 --- a/vignettes/WHONET.Rmd +++ b/vignettes/WHONET.Rmd @@ -23,4 +23,54 @@ knitr::opts_chunk$set( ) ``` -*(will be available soon)* +# Import of data + +This tutorial assumes you already imported the WHONET data with e.g. the [`readxl` package](https://readxl.tidyverse.org/). In RStudio, this can be done using the menu button 'Import Dataset' in the tab 'Environment'. Choose the option 'From Excel' and select your exported file. Make sure date fields are imported correctly. + +An example syntax could look like this: + +```{r, eval = FALSE} +library(readxl) +data <- read_excel(path = "path/to/your/file.xlsx") +``` + +This package comes with an [example data set `WHONET`](./reference/WHONET.html). We will use it for this analysis. + +# Preparation + +First, load the relevant packages if you did not yet did this. I use the tidyverse for all of my analyses. All of them. If you don't know it yet, I suggest you read about it on their website: https://www.tidyverse.org/. + +```{r, message = FALSE} +library(tidyverse) +library(AMR) +``` + +We will have to transform some variables to simplify and automate the analysis: + +* Microorganisms should be transformed to our own microorganism IDs (called an `mo`) using [the ITIS reference data set](./reference/ITIS.html), which contains all ~20,000 microorganisms from the taxonomic kingdoms Bacteria, Fungi and Protozoa. We do the tranformation with `as.mo()`. +* Antimicrobial results or interpretations have to be clean and valid. In other words, they should only contain values `"S"`, `"I"` or `"R"`. That is exactly where the `as.rsi()` function is for. + +```{r} +# transform variables +data <- WHONET %>% + # get microbial ID based on given organism + mutate(mo = as.mo(Organism)) %>% + # transform everything from "AMP_ND10" to "CIP_EE" to the new `rsi` class + mutate_at(vars(AMP_ND10:CIP_EE), as.rsi) +``` + +No errors or warnings, so all values are transformed succesfully. Let's check it though, with a couple of frequency tables: + +```{r, results = 'asis'} +# our newly created `mo` variable +data %>% freq(mo, nmax = 10) + +# our transformed antibiotic columns +# amoxicillin/clavulanic acid (J01CR02) as an example +data %>% freq(AMC_ND2) +``` + +# Analysis + +*(more will be available soon)* +