diff --git a/DESCRIPTION b/DESCRIPTION index 9187fe63..2505ed51 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR Version: 1.7.0 -Date: 2021-05-24 +Date: 2021-05-26 Title: Antimicrobial Resistance Data Analysis Authors@R: c( person(role = c("aut", "cre"), diff --git a/data-raw/AMR_latest.tar.gz b/data-raw/AMR_latest.tar.gz index 635da6bf..4d1b5d59 100644 Binary files a/data-raw/AMR_latest.tar.gz and b/data-raw/AMR_latest.tar.gz differ diff --git a/docs/articles/AMR.html b/docs/articles/AMR.html index c57448a3..092cb056 100644 --- a/docs/articles/AMR.html +++ b/docs/articles/AMR.html @@ -193,7 +193,7 @@

How to conduct AMR data analysis

Matthijs S. Berends

-

24 May 2021

+

26 May 2021

Source: vignettes/AMR.Rmd @@ -202,7 +202,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 R Markdown. However, the methodology remains unchanged. This page was generated on 24 May 2021.

+

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 R Markdown. However, the methodology remains unchanged. This page was generated on 26 May 2021.

Introduction

@@ -233,21 +233,21 @@ -2021-05-24 +2021-05-26 abcd Escherichia coli S S -2021-05-24 +2021-05-26 abcd Escherichia coli S R -2021-05-24 +2021-05-26 efgh Escherichia coli R @@ -344,70 +344,70 @@ -2010-04-11 -W8 -Hospital B -Staphylococcus aureus -S -S -S -S -F - - -2013-06-11 -I7 -Hospital A -Staphylococcus aureus +2013-01-28 +G4 +Hospital D +Escherichia coli S S S S M - -2016-12-30 -C6 -Hospital D -Escherichia coli -R -S -S -S -M - -2010-03-16 -P5 -Hospital B -Staphylococcus aureus -R -S -R -S -F - - -2014-03-27 -U2 +2014-08-13 +O10 Hospital D Escherichia coli -S +R I +R +S +F + + +2011-10-06 +N1 +Hospital B +Escherichia coli +S +S +S +S +M + + +2016-08-07 +J6 +Hospital A +Streptococcus pneumoniae +S +R +S +S +M + + +2010-06-21 +Q4 +Hospital D +Staphylococcus aureus +S +S S S F -2011-01-31 -E5 -Hospital B +2016-04-25 +R4 +Hospital A Escherichia coli -S -S R S -M +S +S +F @@ -424,7 +424,7 @@

Frequency table

Class: character
Length: 20,000
-Available: 20,000 (100%, NA: 0 = 0%)
+Available: 20,000 (100.0%, NA: 0 = 0.0%)
Unique: 2

Shortest: 1
Longest: 1

@@ -441,16 +441,16 @@ Longest: 1

1 M -10,485 -52.43% -10,485 -52.43% +10,403 +52.02% +10,403 +52.02% 2 F -9,515 -47.58% +9,597 +47.99% 20,000 100.00% @@ -505,9 +505,9 @@ Longest: 1

# ℹ Using column 'patient_id' as input for `col_patient_id`. # Basing inclusion on all antimicrobial results, using a points threshold of # 2 -# => Found 10,696 first weighted isolates (phenotype-based, 53.5% of total +# => Found 10,682 first weighted isolates (phenotype-based, 53.4% of total # where a microbial ID was available)
-

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

+

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

 data_1st <- data %>% 
   filter(first == TRUE)
@@ -515,7 +515,7 @@ Longest: 1

 data_1st <- data %>% 
   filter_first_isolate()
-

So we end up with 10,696 isolates for analysis. Now our data looks like:

+

So we end up with 10,682 isolates for analysis. Now our data looks like:

 head(data_1st)
@@ -553,45 +553,13 @@ Longest: 1

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + @@ -601,30 +569,46 @@ Longest: 1

- - - - + + + + - - + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -632,20 +616,36 @@ Longest: 1

- - - - - - + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + @@ -669,8 +669,8 @@ Longest: 1

data_1st %>% freq(genus, species)

Frequency table

Class: character
-Length: 10,696
-Available: 10,696 (100%, NA: 0 = 0%)
+Length: 10,682
+Available: 10,682 (100.0%, NA: 0 = 0.0%)
Unique: 4

Shortest: 16
Longest: 24

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

- - - - + + + + - - - - + + + + - - - - + + + + - - - + + + @@ -760,89 +760,89 @@ Longest: 24

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -870,50 +870,50 @@ Longest: 24

- - - - + + + + - - - - + + + + - + - - + + - + - - + + - - + + - - - - + + + +
62011-01-31E5Hospital BB_ESCHR_COLISSRSMGram-negativeEscherichiacoliTRUE
82016-02-04A9Hospital BB_ESCHR_COLIRRSRMGram-negativeEscherichiacoliTRUE
92015-07-09N1Hospital B42016-08-07J6Hospital A B_STRPT_PNMNSSRR S R M TRUE
102013-11-10M10Hospital B62016-04-25R4Hospital A B_ESCHR_COLI RR S SMSF Gram-negative Escherichia coli TRUE
122013-12-10W8Hospital AB_ESCHR_COLIII102016-01-17R3Hospital DB_STRPT_PNMNSSS RFGram-positiveStreptococcuspneumoniaeTRUE
112013-01-18S1Hospital BB_ESCHR_COLIRRS S F Gram-negative coli TRUE
152016-11-20U2Hospital CB_ESCHR_COLI
162017-07-05X9Hospital DB_STRPT_PNMNS S S RS FGram-negativeEscherichiacoliGram-positiveStreptococcuspneumoniaeTRUE
192013-10-30D4Hospital BB_STRPT_PNMNRRSRMGram-positiveStreptococcuspneumoniae TRUE
1 Escherichia coli4,64843.46%4,64843.46%4,55942.68%4,55942.68%
2 Staphylococcus aureus2,72925.51%7,37768.97%2,84426.62%7,40369.30%
3 Streptococcus pneumoniae2,13619.97%9,51388.94%2,08219.49%9,48588.79%
4 Klebsiella pneumoniae1,18311.06%10,6961,19711.21%10,682 100.00%
2016-02-04A9Hospital BB_ESCHR_COLIRRSRMGram-negativeEscherichiacoliTRUE
2015-07-09N1Hospital BB_STRPT_PNMNSSSRMGram-positiveStreptococcuspneumoniaeTRUE
2017-06-21M8Hospital BB_ESCHR_COLISSRRMGram-negativeEscherichiacoliTRUE
2010-09-28V72016-08-07J6 Hospital A B_STRPT_PNMNSSSRFGram-positiveStreptococcuspneumoniaeTRUE
2012-08-30N9Hospital AB_STRPT_PNMNSS R RFSRM Gram-positive Streptococcus pneumoniae TRUE
2010-08-23I42016-01-17R3 Hospital D B_STRPT_PNMN S S S RFGram-positiveStreptococcuspneumoniaeTRUE
2017-07-05X9Hospital DB_STRPT_PNMNSSSRFGram-positiveStreptococcuspneumoniaeTRUE
2013-10-30D4Hospital BB_STRPT_PNMNRRSRMGram-positiveStreptococcuspneumoniaeTRUE
2012-02-20M7Hospital BB_ESCHR_COLIRSSRMGram-negativeEscherichiacoliTRUE
2010-02-18F5Hospital CB_STRPT_PNMNRRSR M Gram-positive Streptococcus
E. coli AMX223612422884648212915122794559
E. coli AMC346215410324648335515110534559
E. coli CIP34003320 01248464812394559
E. coli GEN40403995 060846485644559
K. pneumoniae AMX 0 01183118311971197
K. pneumoniae AMC937481981183949462021197
@@ -936,34 +936,34 @@ Longest: 24

E. coli GEN -4040 +3995 0 -608 -4648 +564 +4559 K. pneumoniae GEN -1066 +1077 0 -117 -1183 +120 +1197 S. aureus GEN -2418 +2523 0 -311 -2729 +321 +2844 S. pneumoniae GEN 0 0 -2136 -2136 +2082 +2082 @@ -977,7 +977,7 @@ Longest: 24

As per the EUCAST guideline of 2019, we calculate resistance as the proportion of R (proportion_R(), equal to resistance()) and susceptibility as the proportion of S and I (proportion_SI(), equal to susceptibility()). These functions can be used on their own:

 data_1st %>% resistance(AMX)
-# [1] 0.5431002
+# [1] 0.5449354

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

 data_1st %>% 
@@ -991,19 +991,19 @@ Longest: 24

Hospital A -0.5389075 +0.5437286 Hospital B -0.5612520 +0.5478284 Hospital C -0.5325596 +0.5407268 Hospital D -0.5259019 +0.5448113 @@ -1022,23 +1022,23 @@ Longest: 24

Hospital A -0.5389075 -3277 +0.5437286 +3213 Hospital B -0.5612520 -3706 +0.5478284 +3753 Hospital C -0.5325596 -1551 +0.5407268 +1596 Hospital D -0.5259019 -2162 +0.5448113 +2120 @@ -1059,27 +1059,27 @@ Longest: 24

Escherichia -0.7779690 -0.8691910 -0.9733219 +0.7690283 +0.8762887 +0.9782847 Klebsiella -0.8326289 -0.9010989 -0.9805579 +0.8312448 +0.8997494 +0.9874687 Staphylococcus -0.7933309 -0.8860388 -0.9805790 +0.7960619 +0.8871308 +0.9820675 Streptococcus -0.5397940 +0.5249760 0.0000000 -0.5397940 +0.5249760 @@ -1163,19 +1163,19 @@ Longest: 24

mic_values <- random_mic(size = 100) mic_values # Class <mic> -# [1] >=128 <=0.0625 64 4 0.25 16 8 2 -# [9] 0.25 >=128 0.25 >=128 0.25 0.5 64 0.125 -# [17] 2 <=0.0625 0.5 2 1 0.5 32 >=128 -# [25] 0.5 32 >=128 0.25 <=0.0625 <=0.0625 0.5 2 -# [33] >=128 >=128 4 8 <=0.0625 <=0.0625 4 16 -# [41] >=128 32 <=0.0625 >=128 1 <=0.0625 0.5 8 -# [49] 0.125 4 <=0.0625 16 4 32 0.125 8 -# [57] 4 4 16 4 >=128 <=0.0625 4 32 -# [65] 0.125 64 0.5 0.125 0.5 4 16 32 -# [73] 0.125 0.25 4 0.25 4 >=128 >=128 16 -# [81] 1 <=0.0625 0.125 1 4 4 <=0.0625 0.125 -# [89] 0.125 >=128 16 2 0.25 64 8 16 -# [97] 4 >=128 8 >=128
+# [1] 4 <=0.0625 64 0.5 0.5 0.125 128 128 +# [9] 0.5 <=0.0625 4 32 256 0.25 64 8 +# [17] 32 64 4 2 1 4 16 128 +# [25] 128 32 <=0.0625 32 2 4 16 0.125 +# [33] 0.25 0.5 32 128 64 128 0.125 256 +# [41] 1 <=0.0625 64 1 0.25 0.5 <=0.0625 64 +# [49] 8 1 4 2 32 <=0.0625 <=0.0625 4 +# [57] 128 4 32 128 128 32 0.25 64 +# [65] 16 0.5 4 0.5 0.25 4 <=0.0625 2 +# [73] 0.125 0.5 256 <=0.0625 0.5 1 256 0.25 +# [81] 64 64 8 256 16 256 64 16 +# [89] 128 0.125 8 <=0.0625 4 16 128 128 +# [97] 16 128 0.5 1
 # base R:
 plot(mic_values)
@@ -1204,10 +1204,10 @@ Longest: 24

# to review it. disk_values # Class <disk> -# [1] 21 24 22 27 19 23 24 30 27 27 30 22 26 21 29 18 31 31 17 20 24 28 21 20 25 -# [26] 21 17 19 26 28 21 17 30 27 25 30 30 22 21 25 21 19 17 19 28 25 24 27 23 27 -# [51] 26 21 17 18 26 19 31 27 27 25 28 24 20 17 24 21 26 26 26 22 27 27 22 19 23 -# [76] 17 27 22 17 26 30 31 28 27 19 23 24 31 22 28 31 27 31 23 29 19 18 30 27 28 +# [1] 22 19 28 26 29 31 30 27 29 17 20 21 19 28 28 24 30 31 17 26 19 30 31 29 24 +# [26] 18 22 25 26 25 26 21 25 25 21 29 29 22 30 25 30 28 29 29 21 20 22 18 20 25 +# [51] 25 21 27 31 26 17 23 28 21 22 24 25 30 18 26 24 22 22 18 31 20 21 25 22 26 +# [76] 31 30 23 18 31 20 24 21 28 31 18 24 27 28 30 28 29 29 22 28 30 30 25 24 31
 # base R:
 plot(disk_values, mo = "E. coli", ab = "cipro")
diff --git a/docs/articles/AMR_files/figure-html/disk_plots-1.png b/docs/articles/AMR_files/figure-html/disk_plots-1.png index de58936f..305aa845 100644 Binary files a/docs/articles/AMR_files/figure-html/disk_plots-1.png and b/docs/articles/AMR_files/figure-html/disk_plots-1.png differ diff --git a/docs/articles/AMR_files/figure-html/disk_plots_mo_ab-1.png b/docs/articles/AMR_files/figure-html/disk_plots_mo_ab-1.png index b347a9df..20bd42b8 100644 Binary files a/docs/articles/AMR_files/figure-html/disk_plots_mo_ab-1.png and b/docs/articles/AMR_files/figure-html/disk_plots_mo_ab-1.png differ diff --git a/docs/articles/AMR_files/figure-html/mic_plots-1.png b/docs/articles/AMR_files/figure-html/mic_plots-1.png index 6b934096..0c18739b 100644 Binary files a/docs/articles/AMR_files/figure-html/mic_plots-1.png and b/docs/articles/AMR_files/figure-html/mic_plots-1.png differ diff --git a/docs/articles/AMR_files/figure-html/mic_plots-2.png b/docs/articles/AMR_files/figure-html/mic_plots-2.png index 5bd8d690..c884bce7 100644 Binary files a/docs/articles/AMR_files/figure-html/mic_plots-2.png and b/docs/articles/AMR_files/figure-html/mic_plots-2.png differ diff --git a/docs/articles/AMR_files/figure-html/mic_plots_mo_ab-1.png b/docs/articles/AMR_files/figure-html/mic_plots_mo_ab-1.png index fd874052..543631cb 100644 Binary files a/docs/articles/AMR_files/figure-html/mic_plots_mo_ab-1.png and b/docs/articles/AMR_files/figure-html/mic_plots_mo_ab-1.png differ diff --git a/docs/articles/AMR_files/figure-html/mic_plots_mo_ab-2.png b/docs/articles/AMR_files/figure-html/mic_plots_mo_ab-2.png index bb3d3c7e..f8259603 100644 Binary files a/docs/articles/AMR_files/figure-html/mic_plots_mo_ab-2.png and b/docs/articles/AMR_files/figure-html/mic_plots_mo_ab-2.png differ 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 c2cd5254..e7e3ff50 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 0876020b..b700bd62 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 cea782a5..c16b6933 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 319889c0..52c8b629 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/datasets.html b/docs/articles/datasets.html index 6accdab9..26dcbb03 100644 --- a/docs/articles/datasets.html +++ b/docs/articles/datasets.html @@ -192,7 +192,7 @@
diff --git a/docs/news/index.html b/docs/news/index.html index 80311c50..1f24ff51 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -456,7 +456,7 @@ is.rsi.eligible() now detects if the column name resembles an antibiotic name or code and now returns TRUE immediately if the input contains any of the values “R”, “S” or “I”. This drastically improves speed, also for a lot of other functions that rely on automatic determination of antibiotic columns.
  • Functions get_episode() and is_new_episode() now support less than a day as value for argument episode_days (e.g., to include one patient/test per hour)
  • Argument ampc_cephalosporin_resistance in eucast_rules() now also applies to value “I” (not only “S”)
  • -
  • Functions print() and summary() on a Principal Components Analysis object (pca()) now print additional group info if the original data was grouped using dplyr::group_by() +
  • Functions print() and summary() on a Principal Components Analysis object (pca()) now print additional group info if the original data was grouped using dplyr::group_by()
  • Improved speed and reliability of guess_ab_col(). As this also internally improves the reliability of first_isolate() and mdro(), this might have a slight impact on the results of those functions.
  • Fix for mo_name() when used in other languages than English
  • diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 8578f472..a9b6e974 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,4 +1,4 @@ -pandoc: 2.11.2 +pandoc: 2.11.4 pkgdown: 1.6.1 pkgdown_sha: ~ articles: @@ -12,7 +12,7 @@ articles: datasets: datasets.html resistance_predict: resistance_predict.html welcome_to_AMR: welcome_to_AMR.html -last_built: 2021-05-24T12:27Z +last_built: 2021-05-26T09:09Z urls: reference: https://msberends.github.io/AMR//reference article: https://msberends.github.io/AMR//articles diff --git a/docs/reference/resistance_predict.html b/docs/reference/resistance_predict.html index 093fd001..b262b55f 100644 --- a/docs/reference/resistance_predict.html +++ b/docs/reference/resistance_predict.html @@ -276,7 +276,7 @@ plot(x, main = paste("Resistance Prediction of", x_name), ...) # S3 method for resistance_predict -ggplot(x, main = paste("Resistance Prediction of", x_name), ribbon = TRUE, ...) +ggplot(x, main = paste("Resistance Prediction of", x_name), ribbon = TRUE, ...) ggplot_rsi_predict( x, @@ -432,8 +432,10 @@ A microorganism is categorised as Susceptible, Increased exposure when model = "binomial", info = FALSE, minimum = 15) + + ggplot(data) - ggplot(data, + ggplot(as.data.frame(data), aes(x = year)) + geom_col(aes(y = value), fill = "grey75") + diff --git a/index.md b/index.md index 1f93284f..087d88f8 100644 --- a/index.md +++ b/index.md @@ -97,16 +97,16 @@ This package can be used for: ### Get this package #### Latest released version -[![CRAN](https://www.r-pkg.org/badges/version-ago/AMR)](https://cran.r-project.org/package=AMR) -[![CRANlogs](https://cranlogs.r-pkg.org/badges/grand-total/AMR)](https://cran.r-project.org/package=AMR) -This package is available [here on the official R network (CRAN)](https://cran.r-project.org/package=AMR), which has a peer-reviewed submission process. Install this package in R from CRAN by using the command: +This package is available on the [rOpenSci R-universe platform](https://ropensci.org/r-universe/), as CRAN does not allow frequent updates of large packages. With CRAN, we cannot update this package frequently enough to implement the latest EUCAST/CLSI guidelines or the latest microbial taxonomy. + +Install this package in R by using the command: ```r -install.packages("AMR") +install.packages("AMR", repos = "https://msberends.r-universe.dev") ``` -It will be downloaded and installed automatically. For RStudio, click on the menu *Tools* > *Install Packages...* and then type in "AMR" and press Install. +It will be downloaded and installed automatically. **Note:** Not all functions on this website may be available in this latest release. To use all functions and data sets mentioned on this website, install the latest development version.