diff --git a/docs/articles/WHONET.html b/docs/articles/WHONET.html index bf9bffc71..32cddd863 100644 --- a/docs/articles/WHONET.html +++ b/docs/articles/WHONET.html @@ -199,30 +199,31 @@ 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")
+
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)
+
library(dplyr)   # part of tidyverse
+library(ggplot2) # part of tidyverse
+library(AMR)     # this package

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

-
# 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)
+
# 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:

-
# our newly created `mo` variable
-data %>% freq(mo, nmax = 10)
+
# our newly created `mo` variable
+data %>% freq(mo, nmax = 10)

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

@@ -317,10 +318,10 @@

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

-

-# our transformed antibiotic columns
-# amoxicillin/clavulanic acid (J01CR02) as an example
-data %>% freq(AMC_ND2)
+

+# our transformed antibiotic columns
+# amoxicillin/clavulanic acid (J01CR02) as an example
+data %>% freq(AMC_ND2)

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

diff --git a/docs/reference/AMR-deprecated.html b/docs/reference/AMR-deprecated.html index b2dd8802f..9954eca18 100644 --- a/docs/reference/AMR-deprecated.html +++ b/docs/reference/AMR-deprecated.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/AMR.html b/docs/reference/AMR.html index 78d17429d..062871ee8 100644 --- a/docs/reference/AMR.html +++ b/docs/reference/AMR.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/ITIS.html b/docs/reference/ITIS.html index 543f47bd2..fefc8b292 100644 --- a/docs/reference/ITIS.html +++ b/docs/reference/ITIS.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/WHOCC.html b/docs/reference/WHOCC.html index a7e5fac84..50c4ca479 100644 --- a/docs/reference/WHOCC.html +++ b/docs/reference/WHOCC.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/WHONET.html b/docs/reference/WHONET.html index 33ff4385d..7121db55d 100644 --- a/docs/reference/WHONET.html +++ b/docs/reference/WHONET.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/abname.html b/docs/reference/abname.html index b8d53a1eb..5f1de2a58 100644 --- a/docs/reference/abname.html +++ b/docs/reference/abname.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/age.html b/docs/reference/age.html index bc55d4695..9b90ef49f 100644 --- a/docs/reference/age.html +++ b/docs/reference/age.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/age_groups.html b/docs/reference/age_groups.html index a7767c4ca..50b50eee9 100644 --- a/docs/reference/age_groups.html +++ b/docs/reference/age_groups.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/antibiotics.html b/docs/reference/antibiotics.html index bac342186..ef4ea712f 100644 --- a/docs/reference/antibiotics.html +++ b/docs/reference/antibiotics.html @@ -260,11 +260,19 @@

Source

-

- World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: https://www.whocc.no/atc_ddd_index/

+

World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology: https://www.whocc.no/atc_ddd_index/

Table antibiotic coding EARSS (from WHONET 5.3): http://www.madsonline.dk/Tutorials/landskoder_antibiotika_WM.pdf

EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes Tables. Version 3.1, 2016: 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: http://ec.europa.eu/health/documents/community-register/html/atc.htm

+

WHOCC

+ + +


+This package contains 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, https://www.whocc.no) and the Pharmaceuticals Community Register of the European Commission (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.

+

Read more on our website!

@@ -285,6 +293,8 @@ On our website https://msberends.gitla
  • Source
  • +
  • WHOCC
  • +
  • Read more on our website!
  • See also
  • diff --git a/docs/reference/as.atc.html b/docs/reference/as.atc.html index 91fb5147e..ed3d65553 100644 --- a/docs/reference/as.atc.html +++ b/docs/reference/as.atc.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/as.mic.html b/docs/reference/as.mic.html index 03e13b4bd..77b949843 100644 --- a/docs/reference/as.mic.html +++ b/docs/reference/as.mic.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/as.mo.html b/docs/reference/as.mo.html index 436773f30..93bf377ab 100644 --- a/docs/reference/as.mo.html +++ b/docs/reference/as.mo.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/as.rsi.html b/docs/reference/as.rsi.html index aa9dd2c5d..37c5a6faf 100644 --- a/docs/reference/as.rsi.html +++ b/docs/reference/as.rsi.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/atc_property.html b/docs/reference/atc_property.html index 47eeb3e69..81547501a 100644 --- a/docs/reference/atc_property.html +++ b/docs/reference/atc_property.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/count.html b/docs/reference/count.html index 59587c148..66044730d 100644 --- a/docs/reference/count.html +++ b/docs/reference/count.html @@ -81,7 +81,7 @@ count_R and count_IR can be used to count resistant isolates, count_S and count_ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/eucast_rules.html b/docs/reference/eucast_rules.html index 0bb9f0c3d..83dd38155 100644 --- a/docs/reference/eucast_rules.html +++ b/docs/reference/eucast_rules.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/first_isolate.html b/docs/reference/first_isolate.html index b403ddd10..0ed7d132b 100644 --- a/docs/reference/first_isolate.html +++ b/docs/reference/first_isolate.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/freq.html b/docs/reference/freq.html index 2b1966db8..c876a6a23 100644 --- a/docs/reference/freq.html +++ b/docs/reference/freq.html @@ -81,7 +81,7 @@ top_freq can be used to get the top/bottom n items of a frequency table, with co AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/g.test.html b/docs/reference/g.test.html index 96f1e7235..60f4d6a09 100644 --- a/docs/reference/g.test.html +++ b/docs/reference/g.test.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/get_locale.html b/docs/reference/get_locale.html index 2d65dcf73..a287cb6b9 100644 --- a/docs/reference/get_locale.html +++ b/docs/reference/get_locale.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/ggplot_rsi.html b/docs/reference/ggplot_rsi.html index 6ff3dcbd2..232791e39 100644 --- a/docs/reference/ggplot_rsi.html +++ b/docs/reference/ggplot_rsi.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/guess_ab_col.html b/docs/reference/guess_ab_col.html index 5f519a678..7f4362646 100644 --- a/docs/reference/guess_ab_col.html +++ b/docs/reference/guess_ab_col.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/join.html b/docs/reference/join.html index a4d139825..a27493cc4 100644 --- a/docs/reference/join.html +++ b/docs/reference/join.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/key_antibiotics.html b/docs/reference/key_antibiotics.html index e4f0c6f2e..312e507e5 100644 --- a/docs/reference/key_antibiotics.html +++ b/docs/reference/key_antibiotics.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/kurtosis.html b/docs/reference/kurtosis.html index ebee3401d..903dccb88 100644 --- a/docs/reference/kurtosis.html +++ b/docs/reference/kurtosis.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/like.html b/docs/reference/like.html index aca4cbce7..328da920f 100644 --- a/docs/reference/like.html +++ b/docs/reference/like.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/mdro.html b/docs/reference/mdro.html index 5dbd3d830..a13074c95 100644 --- a/docs/reference/mdro.html +++ b/docs/reference/mdro.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/microorganisms.codes.html b/docs/reference/microorganisms.codes.html index e374d5a48..b2420f47e 100644 --- a/docs/reference/microorganisms.codes.html +++ b/docs/reference/microorganisms.codes.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/microorganisms.html b/docs/reference/microorganisms.html index 84360f302..314d66ff9 100644 --- a/docs/reference/microorganisms.html +++ b/docs/reference/microorganisms.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/microorganisms.old.html b/docs/reference/microorganisms.old.html index 142952ccb..ef7e769bd 100644 --- a/docs/reference/microorganisms.old.html +++ b/docs/reference/microorganisms.old.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/mo_property.html b/docs/reference/mo_property.html index 65dc3584b..2167e5266 100644 --- a/docs/reference/mo_property.html +++ b/docs/reference/mo_property.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/mo_source.html b/docs/reference/mo_source.html index bc0b9367f..0d7ffd429 100644 --- a/docs/reference/mo_source.html +++ b/docs/reference/mo_source.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/p.symbol.html b/docs/reference/p.symbol.html index 7341b4624..9e313d7db 100644 --- a/docs/reference/p.symbol.html +++ b/docs/reference/p.symbol.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/portion.html b/docs/reference/portion.html index db801e517..59f096fe8 100644 --- a/docs/reference/portion.html +++ b/docs/reference/portion.html @@ -81,7 +81,7 @@ portion_R and portion_IR can be used to calculate resistance, portion_S and port AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/read.4D.html b/docs/reference/read.4D.html index cb9522777..7e7ac3b0d 100644 --- a/docs/reference/read.4D.html +++ b/docs/reference/read.4D.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/resistance_predict.html b/docs/reference/resistance_predict.html index 663d45868..b52f21733 100644 --- a/docs/reference/resistance_predict.html +++ b/docs/reference/resistance_predict.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/septic_patients.html b/docs/reference/septic_patients.html index 02b912a11..4e8136ed8 100644 --- a/docs/reference/septic_patients.html +++ b/docs/reference/septic_patients.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/skewness.html b/docs/reference/skewness.html index 70fa067b0..9faacd29c 100644 --- a/docs/reference/skewness.html +++ b/docs/reference/skewness.html @@ -81,7 +81,7 @@ When negative: the left tail is longer; the mass of the distribution is concentr AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/docs/reference/supplementary_data.html b/docs/reference/supplementary_data.html index 410879cfc..2a65a4721 100644 --- a/docs/reference/supplementary_data.html +++ b/docs/reference/supplementary_data.html @@ -80,7 +80,7 @@ AMR (for R) - 0.5.0.9015 + 0.5.0.9016 diff --git a/vignettes/WHONET.Rmd b/vignettes/WHONET.Rmd index 63c760835..3cb711445 100644 --- a/vignettes/WHONET.Rmd +++ b/vignettes/WHONET.Rmd @@ -41,8 +41,9 @@ This package comes with an [example data set `WHONET`](./reference/WHONET.html). 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) +library(dplyr) # part of tidyverse +library(ggplot2) # part of tidyverse +library(AMR) # this package ``` We will have to transform some variables to simplify and automate the analysis: