diff --git a/docs/articles/WHONET.html b/docs/articles/WHONET.html index bf9bffc7..32cddd86 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 b2dd8802..9954eca1 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 78d17429..062871ee 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 543f47bd..fefc8b29 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 a7e5fac8..50c4ca47 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 33ff4385..7121db55 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 b8d53a1e..5f1de2a5 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 bc55d469..9b90ef49 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 a7767c4c..50b50eee 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 bac34218..ef4ea712 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 91fb5147..ed3d6555 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 03e13b4b..77b94984 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 436773f3..93bf377a 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 aa9dd2c5..37c5a6fa 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 47eeb3e6..81547501 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 59587c14..66044730 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 0bb9f0c3..83dd3815 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 b403ddd1..0ed7d132 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 2b1966db..c876a6a2 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 96f1e723..60f4d6a0 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 2d65dcf7..a287cb6b 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 6ff3dcbd..232791e3 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 5f519a67..7f436264 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 a4d13982..a27493cc 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 e4f0c6f2..312e507e 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 ebee3401..903dccb8 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 aca4cbce..328da920 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 5dbd3d83..a13074c9 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 e374d5a4..b2420f47 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 84360f30..314d66ff 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 142952cc..ef7e769b 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 65dc3584..2167e526 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 bc0b9367..0d7ffd42 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 7341b462..9e313d7d 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 db801e51..59f096fe 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 cb952277..7e7ac3b0 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 663d4586..b52f2173 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 02b912a1..4e8136ed 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 70fa067b..9faacd29 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 410879cf..2a65a472 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 63c76083..3cb71144 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: