Browse Source

EUCAST update, as.mo bugfix for empty vlaues

main
parent
commit
193a2d2863
  1. 1
      .gitignore
  2. 2
      DESCRIPTION
  3. 8
      NEWS.md
  4. 2
      R/data.R
  5. 128
      R/eucast_rules.R
  6. 6
      R/itis.R
  7. 28
      R/mo.R
  8. 10
      R/mo_property.R
  9. 12
      _pkgdown.yml
  10. 780
      docs/articles/AMR.html
  11. BIN
      docs/articles/AMR_files/figure-html/plot 1-1.png
  12. BIN
      docs/articles/AMR_files/figure-html/plot 3-1.png
  13. BIN
      docs/articles/AMR_files/figure-html/plot 4-1.png
  14. BIN
      docs/articles/AMR_files/figure-html/plot 5-1.png
  15. 3
      docs/articles/EUCAST.html
  16. 3
      docs/articles/G_test.html
  17. 1
      docs/articles/Predict.html
  18. 1
      docs/articles/ab_property.html
  19. 69
      docs/articles/freq.html
  20. 1
      docs/articles/mo_property.html
  21. 11
      docs/extra.css
  22. 2
      docs/extra.js
  23. 26
      docs/index.html
  24. 214
      docs/news/index.html
  25. 2
      docs/pkgdown.yml
  26. 316
      docs/reference/ITIS.html
  27. 8
      docs/reference/age_groups.html
  28. 4
      docs/reference/as.rsi.html
  29. 16
      docs/reference/count.html
  30. 128
      docs/reference/eucast_rules.html
  31. 12
      docs/reference/first_isolate.html
  32. 18
      docs/reference/freq.html
  33. 36
      docs/reference/ggplot_rsi.html
  34. 6
      docs/reference/index.html
  35. 4
      docs/reference/join.html
  36. 2
      docs/reference/like.html
  37. 124
      docs/reference/mdro.html
  38. 2
      docs/reference/microorganisms.certe.html
  39. 2
      docs/reference/microorganisms.umcg.html
  40. 26
      docs/reference/portion.html
  41. 8
      docs/reference/resistance_predict.html
  42. 6
      docs/sitemap.xml
  43. 6
      man/ITIS.Rd
  44. 128
      man/eucast_rules.Rd
  45. 124
      man/mdro.Rd
  46. 11
      pkgdown/extra.css
  47. 2
      pkgdown/extra.js
  48. 1
      vignettes/AMR.Rmd
  49. 3
      vignettes/EUCAST.Rmd
  50. 3
      vignettes/G_test.Rmd
  51. 1
      vignettes/Predict.Rmd
  52. 1
      vignettes/ab_property.Rmd
  53. 1
      vignettes/freq.Rmd
  54. 1
      vignettes/mo_property.Rmd

1
.gitignore vendored

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
Meta
doc
.Renviron
.Rproj.user
.Rhistory
.RData

2
DESCRIPTION

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
Package: AMR
Version: 0.5.0.9009
Date: 2019-01-06
Date: 2019-01-08
Title: Antimicrobial Resistance Analysis
Authors@R: c(
person(

8
NEWS.md

@ -28,9 +28,13 @@ @@ -28,9 +28,13 @@
* New vignettes about how to conduct AMR analysis, predict antimicrobial resistance, use the *G*-test and more. These are also available (and even easier readable) on our website: https://msberends.gitlab.io/AMR.
#### Changed
* Function `guess_mo()` is now deprecated in favour of `as.mo()` and will be remover in future versions
* Fixed a critical bug in `eucast_rules()` where some rules that depend on previous applied rules would not be applied adequately
* Function `eucast_rules()`:
* Updated EUCAST Clinical breakpoints to [version 9.0 of 1 January 2019](http://www.eucast.org/clinical_breakpoints/)
* Fixed a critical bug where some rules that depend on previous applied rules would not be applied adequately
* Emphasised in manual that penicillin is meant as benzylpenicillin (ATC [J01CE01](https://www.whocc.no/atc_ddd_index/?code=J01CE01))
* Function `guess_mo()` is now deprecated in favour of `as.mo()` and will be removed in future versions
* Improvements for `as.mo()`:
* Fix for vector containing only empty values
* Finds better results when input is in other languages
* Better handling for subspecies
* Better handling for *Salmonellae*

2
R/data.R

@ -127,7 +127,7 @@ @@ -127,7 +127,7 @@
#' Data set with taxonomic data from ITIS
#'
#' A data set containing the complete microbial taxonomy of the kingdoms Bacteria, Fungi and Protozoa. MO codes can be looked up using \code{\link{as.mo}}.
#' @inheritSection itis ITIS
#' @inheritSection ITIS ITIS
#' @format A \code{\link{data.frame}} with 18,833 observations and 15 variables:
#' \describe{
#' \item{\code{mo}}{ID of microorganism}

128
R/eucast_rules.R

@ -34,68 +34,68 @@ @@ -34,68 +34,68 @@
#'
#' Abbrevations of the column containing antibiotics in the form: \strong{abbreviation}: generic name (\emph{ATC code})
#'
#' \strong{amcl}: amoxicillin+clavulanic acid (\emph{J01CR02}),
#' \strong{amik}: amikacin (\emph{J01GB06}),
#' \strong{amox}: amoxicillin (\emph{J01CA04}),
#' \strong{ampi}: ampicillin (\emph{J01CA01}),
#' \strong{azit}: azithromycin (\emph{J01FA10}),
#' \strong{azlo}: azlocillin (\emph{J01CA09}),
#' \strong{aztr}: aztreonam (\emph{J01DF01}),
#' \strong{cefa}: cefaloridine (\emph{J01DB02}),
#' \strong{cfep}: cefepime (\emph{J01DE01}),
#' \strong{cfot}: cefotaxime (\emph{J01DD01}),
#' \strong{cfox}: cefoxitin (\emph{J01DC01}),
#' \strong{cfra}: cefradine (\emph{J01DB09}),
#' \strong{cfta}: ceftazidime (\emph{J01DD02}),
#' \strong{cftr}: ceftriaxone (\emph{J01DD04}),
#' \strong{cfur}: cefuroxime (\emph{J01DC02}),
#' \strong{chlo}: chloramphenicol (\emph{J01BA01}),
#' \strong{cipr}: ciprofloxacin (\emph{J01MA02}),
#' \strong{clar}: clarithromycin (\emph{J01FA09}),
#' \strong{clin}: clindamycin (\emph{J01FF01}),
#' \strong{clox}: flucloxacillin (\emph{J01CF05}),
#' \strong{coli}: colistin (\emph{J01XB01}),
#' \strong{czol}: cefazolin (\emph{J01DB04}),
#' \strong{dapt}: daptomycin (\emph{J01XX09}),
#' \strong{doxy}: doxycycline (\emph{J01AA02}),
#' \strong{erta}: ertapenem (\emph{J01DH03}),
#' \strong{eryt}: erythromycin (\emph{J01FA01}),
#' \strong{fosf}: fosfomycin (\emph{J01XX01}),
#' \strong{fusi}: fusidic acid (\emph{J01XC01}),
#' \strong{gent}: gentamicin (\emph{J01GB03}),
#' \strong{imip}: imipenem (\emph{J01DH51}),
#' \strong{kana}: kanamycin (\emph{J01GB04}),
#' \strong{levo}: levofloxacin (\emph{J01MA12}),
#' \strong{linc}: lincomycin (\emph{J01FF02}),
#' \strong{line}: linezolid (\emph{J01XX08}),
#' \strong{mero}: meropenem (\emph{J01DH02}),
#' \strong{mezl}: mezlocillin (\emph{J01CA10}),
#' \strong{mino}: minocycline (\emph{J01AA08}),
#' \strong{moxi}: moxifloxacin (\emph{J01MA14}),
#' \strong{nali}: nalidixic acid (\emph{J01MB02}),
#' \strong{neom}: neomycin (\emph{J01GB05}),
#' \strong{neti}: netilmicin (\emph{J01GB07}),
#' \strong{nitr}: nitrofurantoin (\emph{J01XE01}),
#' \strong{norf}: norfloxacin (\emph{J01MA06}),
#' \strong{novo}: novobiocin (an ATCvet code: \emph{QJ01XX95}),
#' \strong{oflo}: ofloxacin (\emph{J01MA01}),
#' \strong{peni}: penicillin (\emph{J01RA01}),
#' \strong{pipe}: piperacillin (\emph{J01CA12}),
#' \strong{pita}: piperacillin+tazobactam (\emph{J01CR05}),
#' \strong{poly}: polymyxin B (\emph{J01XB02}),
#' \strong{pris}: pristinamycin (\emph{J01FG01}),
#' \strong{qida}: quinupristin/dalfopristin (\emph{J01FG02}),
#' \strong{rifa}: rifampicin (\emph{J04AB02}),
#' \strong{roxi}: roxithromycin (\emph{J01FA06}),
#' \strong{siso}: sisomicin (\emph{J01GB08}),
#' \strong{teic}: teicoplanin (\emph{J01XA02}),
#' \strong{tetr}: tetracycline (\emph{J01AA07}),
#' \strong{tica}: ticarcillin (\emph{J01CA13}),
#' \strong{tige}: tigecycline (\emph{J01AA12}),
#' \strong{tobr}: tobramycin (\emph{J01GB01}),
#' \strong{trim}: trimethoprim (\emph{J01EA01}),
#' \strong{trsu}: sulfamethoxazole and trimethoprim (\emph{J01EE01}),
#' \strong{vanc}: vancomycin (\emph{J01XA01}).
#' \strong{amcl}: amoxicillin+clavulanic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR02}{J01CR02}),
#' \strong{amik}: amikacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB06}{J01GB06}),
#' \strong{amox}: amoxicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA04}{J01CA04}),
#' \strong{ampi}: ampicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA01}{J01CA01}),
#' \strong{azit}: azithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA10}{J01FA10}),
#' \strong{azlo}: azlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA09}{J01CA09}),
#' \strong{aztr}: aztreonam (\href{https://www.whocc.no/atc_ddd_index/?code=J01DF01}{J01DF01}),
#' \strong{cefa}: cefaloridine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB02}{J01DB02}),
#' \strong{cfep}: cefepime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DE01}{J01DE01}),
#' \strong{cfot}: cefotaxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD01}{J01DD01}),
#' \strong{cfox}: cefoxitin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC01}{J01DC01}),
#' \strong{cfra}: cefradine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB09}{J01DB09}),
#' \strong{cfta}: ceftazidime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD02}{J01DD02}),
#' \strong{cftr}: ceftriaxone (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD04}{J01DD04}),
#' \strong{cfur}: cefuroxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC02}{J01DC02}),
#' \strong{chlo}: chloramphenicol (\href{https://www.whocc.no/atc_ddd_index/?code=J01BA01}{J01BA01}),
#' \strong{cipr}: ciprofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA02}{J01MA02}),
#' \strong{clar}: clarithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA09}{J01FA09}),
#' \strong{clin}: clindamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF01}{J01FF01}),
#' \strong{clox}: flucloxacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CF05}{J01CF05}),
#' \strong{coli}: colistin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB01}{J01XB01}),
#' \strong{czol}: cefazolin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB04}{J01DB04}),
#' \strong{dapt}: daptomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX09}{J01XX09}),
#' \strong{doxy}: doxycycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA02}{J01AA02}),
#' \strong{erta}: ertapenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH03}{J01DH03}),
#' \strong{eryt}: erythromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA01}{J01FA01}),
#' \strong{fosf}: fosfomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX01}{J01XX01}),
#' \strong{fusi}: fusidic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XC01}{J01XC01}),
#' \strong{gent}: gentamicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB03}{J01GB03}),
#' \strong{imip}: imipenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH51}{J01DH51}),
#' \strong{kana}: kanamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB04}{J01GB04}),
#' \strong{levo}: levofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA12}{J01MA12}),
#' \strong{linc}: lincomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF02}{J01FF02}),
#' \strong{line}: linezolid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX08}{J01XX08}),
#' \strong{mero}: meropenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH02}{J01DH02}),
#' \strong{mezl}: mezlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA10}{J01CA10}),
#' \strong{mino}: minocycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA08}{J01AA08}),
#' \strong{moxi}: moxifloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA14}{J01MA14}),
#' \strong{nali}: nalidixic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01MB02}{J01MB02}),
#' \strong{neom}: neomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB05}{J01GB05}),
#' \strong{neti}: netilmicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB07}{J01GB07}),
#' \strong{nitr}: nitrofurantoin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XE01}{J01XE01}),
#' \strong{norf}: norfloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA06}{J01MA06}),
#' \strong{novo}: novobiocin (an ATCvet code: \href{https://www.whocc.no/atc_ddd_index/?code=QJ01XX95}{QJ01XX95}),
#' \strong{oflo}: ofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA01}{J01MA01}),
#' \strong{peni}: (benzyl)penicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CE01}{J01CE01}),
#' \strong{pipe}: piperacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA12}{J01CA12}),
#' \strong{pita}: piperacillin+tazobactam (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR05}{J01CR05}),
#' \strong{poly}: polymyxin B (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB02}{J01XB02}),
#' \strong{pris}: pristinamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG01}{J01FG01}),
#' \strong{qida}: quinupristin/dalfopristin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG02}{J01FG02}),
#' \strong{rifa}: rifampicin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB02}{J04AB02}),
#' \strong{roxi}: roxithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA06}{J01FA06}),
#' \strong{siso}: sisomicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB08}{J01GB08}),
#' \strong{teic}: teicoplanin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA02}{J01XA02}),
#' \strong{tetr}: tetracycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA07}{J01AA07}),
#' \strong{tica}: ticarcillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA13}{J01CA13}),
#' \strong{tige}: tigecycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA12}{J01AA12}),
#' \strong{tobr}: tobramycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB01}{J01GB01}),
#' \strong{trim}: trimethoprim (\href{https://www.whocc.no/atc_ddd_index/?code=J01EA01}{J01EA01}),
#' \strong{trsu}: sulfamethoxazole and trimethoprim (\href{https://www.whocc.no/atc_ddd_index/?code=J01EE01}{J01EE01}),
#' \strong{vanc}: vancomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA01}{J01XA01}).
#' @keywords interpretive eucast reading resistance
#' @rdname eucast_rules
#' @export
@ -114,8 +114,8 @@ @@ -114,8 +114,8 @@
#' \url{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf}
#' }
#' \item{
#' EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 8.1, 2018. \cr
#' \url{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_8.1_Breakpoint_Tables.xlsx}
#' EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 9.0, 2019. \cr
#' \url{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_9.0_Breakpoint_Tables.xlsx}
#' }
#' }
#' @inheritSection AMR Read more on our website!

6
R/itis.R

@ -30,12 +30,12 @@ @@ -30,12 +30,12 @@
#'
#' ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists [3].
#' @inheritSection AMR Read more on our website!
#' @name itis
#' @rdname itis
#' @name ITIS
#' @rdname ITIS
#' @examples
#' # Get a note when a species was renamed
#' mo_shortname("Chlamydia psittaci")
#' # Note: 'Chlamydia psittaci' (Page, 1968) was renamed
#' # Note: 'Chlamydia psittaci' (Page, 1968) was renamed
#' # 'Chlamydophila psittaci' (Everett et al., 1999)
#' # [1] "C. psittaci"
#'

28
R/mo.R

@ -76,7 +76,7 @@ @@ -76,7 +76,7 @@
#' \item{\code{"D. spartina"}. This is the abbreviation of an old taxonomic name: \emph{Didymosphaeria spartinae} (the last "e" was missing from the input). This fungus was renamed to \emph{Leptosphaeria obiones}, so a warning will be thrown that this result (\code{F_LPTSP_OBI}) needs review.}
#' }
#'
#' @inheritSection itis ITIS
#' @inheritSection ITIS ITIS
# (source as a section, so it can be inherited by other man pages)
#' @section Source:
#' [1] Becker K \emph{et al.} \strong{Coagulase-Negative Staphylococci}. 2014. Clin Microbiol Rev. 27(4): 870–926. \url{https://dx.doi.org/10.1128/CMR.00109-13}
@ -211,8 +211,16 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE, @@ -211,8 +211,16 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE,
reference_df[] <- lapply(reference_df, as.character)
)
}
if (all(x %in% microorganismsDT[["mo"]])) {
if (all(identical(trimws(x_input), "") | is.na(x_input))) {
# all empty
if (property == "mo") {
return(structure(rep(NA_character_, length(x_input)), class = "mo"))
} else if (property == "tsn") {
return(rep(NA_integer_, length(x_input)))
} else {
return(rep(NA_character_, length(x_input)))
}
} else if (all(x %in% microorganismsDT[["mo"]])) {
# existing mo codes when not looking for property "mo", like mo_genus("B_ESCHR_COL")
x <- microorganismsDT[data.table(mo = x), on = "mo", ..property][[1]]
} else if (!is.null(reference_df)
@ -665,6 +673,16 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE, @@ -665,6 +673,16 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE,
}
}
# (4) not yet implemented taxonomic changes in ITIS
found <- suppressMessages(suppressWarnings(exec_as.mo(temp_changes(b.x_trimmed), clear_options = FALSE, allow_uncertain = FALSE)))
if (!is.na(found)) {
found <- microorganismsDT[mo == found, ..property][[1]]
warning(red(paste0('UNCERTAIN - "',
a.x_backup, '" -> ', italic(microorganismsDT[mo == found[1L], fullname][[1]]), " (", found[1L], ")")),
call. = FALSE, immediate. = FALSE)
return(found[1L])
}
# didn't found in uncertain results too
return(NA_character_)
}
@ -780,6 +798,10 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE, @@ -780,6 +798,10 @@ exec_as.mo <- function(x, Becker = FALSE, Lancefield = FALSE,
x
}
temp_changes <- function(x) {
x[x %like% 'Cutibacterium'] <- gsub('Cutibacterium', 'Propionibacterium', x[x %like% 'Cutibacterium'])
}
#' @importFrom crayon blue italic
renamed_note <- function(name_old, name_new, ref_old = "", ref_new = "", mo = "") {
if (!is.na(ref_old)) {

10
R/mo_property.R

@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
#' \item{\code{mo_ref("Chlamydophila psittaci")} will return \code{"Everett et al., 1999"} (without a warning)}
#' }
#' @inheritSection get_locale Supported languages
#' @inheritSection itis ITIS
#' @inheritSection ITIS ITIS
#' @inheritSection as.mo Source
#' @rdname mo_property
#' @name mo_property
@ -480,6 +480,12 @@ mo_validate <- function(x, property, ...) { @@ -480,6 +480,12 @@ mo_validate <- function(x, property, ...) {
| Lancefield %in% c(TRUE, "all")) {
exec_as.mo(x, property = property, ...)
} else {
x
if (property == "mo") {
return(structure(x, class = "mo"))
} else if (property == "tsn") {
return(as.integer(x))
} else {
return(x)
}
}
}

12
_pkgdown.yml

@ -71,13 +71,13 @@ navbar: @@ -71,13 +71,13 @@ navbar:
href: 'LICENSE-text.html'
reference:
- title: Backround information
- title: 'Background information'
desc: >
Some pages about our package and its external sources.
contents:
- '`AMR`'
- '`itis`'
- title: Cleaning your data
- '`ITIS`'
- title: 'Cleaning your data'
desc: >
Functions for cleaning and optimising your data, to be able
to add variables later on (like taxonomic properties) or to
@ -87,7 +87,7 @@ reference: @@ -87,7 +87,7 @@ reference:
- '`eucast_rules`'
- '`guess_ab`'
- '`read.4D`'
- title: Adding variables to your data
- title: 'Adding variables to your data'
desc: >
Functions to add new data to existing data, like the determination
of first isolates,
@ -103,7 +103,7 @@ reference: @@ -103,7 +103,7 @@ reference:
- '`age_groups`'
- '`p.symbol`'
- '`join`'
- title: Analysing your data
- title: 'Analysing your data'
desc: >
Functions for conducting AMR analysis
contents:
@ -116,7 +116,7 @@ reference: @@ -116,7 +116,7 @@ reference:
- '`resistance_predict`'
- '`rsi`'
- '`skewness`'
- title: Included data sets
- title: 'Included data sets'
desc: >
References for microorganisms and antibiotics, and even a
genuine data set with isolates from septic patients.

780
docs/articles/AMR.html

File diff suppressed because it is too large Load Diff

BIN
docs/articles/AMR_files/figure-html/plot 1-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

BIN
docs/articles/AMR_files/figure-html/plot 3-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

BIN
docs/articles/AMR_files/figure-html/plot 4-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 65 KiB

BIN
docs/articles/AMR_files/figure-html/plot 5-1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

3
docs/articles/EUCAST.html

@ -171,6 +171,7 @@ @@ -171,6 +171,7 @@
<h1>How to apply EUCAST rules</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">08 January 2019</h4>
<div class="hidden name"><code>EUCAST.Rmd</code></div>
@ -186,7 +187,7 @@ @@ -186,7 +187,7 @@
<blockquote>
<p><em>EUCAST expert rules are a tabulated collection of expert knowledge on intrinsic resistances, exceptional resistance phenotypes and interpretive rules that may be applied to antimicrobial susceptibility testing in order to reduce errors and make appropriate recommendations for reporting particular resistances.</em></p>
</blockquote>
<p>In Europe, most medical microbiological laboratories already apply these rules. Our package features their latest insights on intrinsic resistance and exceptional phenotypes. Moreover, the <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code> function we use for this purpose can also apply additional rules, like forcing <help title="ATC: J01CA01">ampicillin</help> = R in isolates when <help title="ATC: J01CR02">amoxicillin/clavulanic acid</help> = R.</p>
<p>In Europe, a lot of medical microbiological laboratories already apply these rules (<a href="https://www.eurosurveillance.org/content/10.2807/1560-7917.ES2015.20.2.21008">Brown <em>et al.</em>, 2015</a>). Our package features their latest insights on intrinsic resistance and exceptional phenotypes (version 9.0, 2019). Moreover, the <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code> function we use for this purpose can also apply additional rules, like forcing <help title="ATC: J01CA01">ampicillin</help> = R in isolates when <help title="ATC: J01CR02">amoxicillin/clavulanic acid</help> = R.</p>
<p><em>(more will be available soon)</em></p>
<div id="benefit-for-empiric-therapy-success-estimation" class="section level3">
<h3 class="hasAnchor">

3
docs/articles/G_test.html

@ -171,6 +171,7 @@ @@ -171,6 +171,7 @@
<h1>How to use the <em>G</em>-test</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">08 January 2019</h4>
<div class="hidden name"><code>G_test.Rmd</code></div>
@ -179,7 +180,7 @@ @@ -179,7 +180,7 @@
<p><em>(will be available soon - in the meanwhile, please read about <a href="./reference/g.test.html">this <em>G</em>-test in the manual</a>)</em></p>
<p><em>(will be available soon - in the meanwhile, please read about <a href="./../reference/g.test.html">this <em>G</em>-test in the manual</a>)</em></p>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">

1
docs/articles/Predict.html

@ -171,6 +171,7 @@ @@ -171,6 +171,7 @@
<h1>How to predict antimicrobial resistance</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">08 January 2019</h4>
<div class="hidden name"><code>Predict.Rmd</code></div>

1
docs/articles/ab_property.html

@ -171,6 +171,7 @@ @@ -171,6 +171,7 @@
<h1>How to get properties of an antibiotic</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">08 January 2019</h4>
<div class="hidden name"><code>ab_property.Rmd</code></div>

69
docs/articles/freq.html

@ -171,6 +171,7 @@ @@ -171,6 +171,7 @@
<h1>How to create frequency tables</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">08 January 2019</h4>
<div class="hidden name"><code>freq.Rmd</code></div>
@ -188,7 +189,7 @@ @@ -188,7 +189,7 @@
<h2 class="hasAnchor">
<a href="#frequencies-of-one-variable" class="anchor"></a>Frequencies of one variable</h2>
<p>To only show and quickly review the content of one variable, you can just select this variable in various ways. Let’s say we want to get the frequencies of the <code>gender</code> variable of the <code>septic_patients</code> dataset:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">septic_patients %&gt;%<span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(gender)</code></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(gender)</a></code></pre></div>
<p><strong>Frequency table of <code>gender</code></strong></p>
<table class="table">
<thead><tr class="header">
@ -225,21 +226,21 @@ @@ -225,21 +226,21 @@
<a href="#frequencies-of-more-than-one-variable" class="anchor"></a>Frequencies of more than one variable</h2>
<p>Multiple variables will be pasted into one variable to review individual cases, keeping a univariate frequency table.</p>
<p>For illustration, we could add some more variables to the <code>septic_patients</code> dataset to learn about bacterial properties:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">my_patients &lt;-<span class="st"> </span>septic_patients %&gt;%<span class="st"> </span><span class="kw"><a href="../reference/join.html">left_join_microorganisms</a></span>()
<span class="co"># Joining, by = "mo"</span></code></pre></div>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1">my_patients &lt;-<span class="st"> </span>septic_patients <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/join.html">left_join_microorganisms</a></span>()</a>
<a class="sourceLine" id="cb2-2" data-line-number="2"><span class="co"># Joining, by = "mo"</span></a></code></pre></div>
<p>Now all variables of the <code>microorganisms</code> dataset have been joined to the <code>septic_patients</code> dataset. The <code>microorganisms</code> dataset consists of the following variables:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/colnames">colnames</a></span>(microorganisms)
<span class="co"># [1] "mo" "tsn" "genus" "species" "subspecies"</span>
<span class="co"># [6] "fullname" "family" "order" "class" "phylum" </span>
<span class="co"># [11] "subkingdom" "kingdom" "gramstain" "prevalence" "ref"</span></code></pre></div>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/colnames">colnames</a></span>(microorganisms)</a>
<a class="sourceLine" id="cb3-2" data-line-number="2"><span class="co"># [1] "mo" "tsn" "genus" "species" "subspecies"</span></a>
<a class="sourceLine" id="cb3-3" data-line-number="3"><span class="co"># [6] "fullname" "family" "order" "class" "phylum" </span></a>
<a class="sourceLine" id="cb3-4" data-line-number="4"><span class="co"># [11] "subkingdom" "kingdom" "gramstain" "prevalence" "ref"</span></a></code></pre></div>
<p>If we compare the dimensions between the old and new dataset, we can see that these 14 variables were added:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/dim">dim</a></span>(septic_patients)
<span class="co"># [1] 2000 49</span>
<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/dim">dim</a></span>(my_patients)
<span class="co"># [1] 2000 63</span></code></pre></div>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/dim">dim</a></span>(septic_patients)</a>
<a class="sourceLine" id="cb4-2" data-line-number="2"><span class="co"># [1] 2000 49</span></a>
<a class="sourceLine" id="cb4-3" data-line-number="3"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/dim">dim</a></span>(my_patients)</a>
<a class="sourceLine" id="cb4-4" data-line-number="4"><span class="co"># [1] 2000 63</span></a></code></pre></div>
<p>So now the <code>genus</code> and <code>species</code> variables are available. A frequency table of these combined variables can be created like this:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">my_patients %&gt;%
<span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(genus, species, <span class="dt">nmax =</span> <span class="dv">15</span>)</code></pre></div>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" data-line-number="1">my_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb5-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(genus, species, <span class="dt">nmax =</span> <span class="dv">15</span>)</a></code></pre></div>
<p><strong>Frequency table of <code>genus</code> and <code>species</code></strong></p>
<table class="table">
<thead><tr class="header">
@ -380,10 +381,10 @@ @@ -380,10 +381,10 @@
<a href="#frequencies-of-numeric-values" class="anchor"></a>Frequencies of numeric values</h2>
<p>Frequency tables can be created of any input.</p>
<p>In case of numeric values (like integers, doubles, etc.) additional descriptive statistics will be calculated and shown into the header:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co"># # get age distribution of unique patients</span>
septic_patients %&gt;%<span class="st"> </span>
<span class="st"> </span><span class="kw">distinct</span>(patient_id, <span class="dt">.keep_all =</span> <span class="ot">TRUE</span>) %&gt;%<span class="st"> </span>
<span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(age, <span class="dt">nmax =</span> <span class="dv">5</span>, <span class="dt">header =</span> <span class="ot">TRUE</span>)</code></pre></div>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1"><span class="co"># # get age distribution of unique patients</span></a>
<a class="sourceLine" id="cb6-2" data-line-number="2">septic_patients <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb6-3" data-line-number="3"><span class="st"> </span><span class="kw">distinct</span>(patient_id, <span class="dt">.keep_all =</span> <span class="ot">TRUE</span>) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb6-4" data-line-number="4"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(age, <span class="dt">nmax =</span> <span class="dv">5</span>, <span class="dt">header =</span> <span class="ot">TRUE</span>)</a></code></pre></div>
<p><strong>Frequency table of <code>age</code></strong><br>
Class: numeric<br>
Length: 981 (of which NA: 0 = 0.00%)<br>
@ -461,8 +462,8 @@ Outliers: 15 (unique count: 12)</p> @@ -461,8 +462,8 @@ Outliers: 15 (unique count: 12)</p>
<a href="#frequencies-of-factors" class="anchor"></a>Frequencies of factors</h2>
<p>To sort frequencies of factors on factor level instead of item count, use the <code>sort.count</code> parameter.</p>
<p><code>sort.count</code> is <code>TRUE</code> by default. Compare this default behaviour…</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">septic_patients %&gt;%
<span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(hospital_id)</code></pre></div>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb7-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb7-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(hospital_id)</a></code></pre></div>
<p><strong>Frequency table of <code>hospital_id</code></strong></p>
<table class="table">
<thead><tr class="header">
@ -509,8 +510,8 @@ Outliers: 15 (unique count: 12)</p> @@ -509,8 +510,8 @@ Outliers: 15 (unique count: 12)</p>
</tbody>
</table>
<p>… with this, where items are now sorted on count:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">septic_patients %&gt;%
<span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(hospital_id, <span class="dt">sort.count =</span> <span class="ot">FALSE</span>)</code></pre></div>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb8-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb8-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(hospital_id, <span class="dt">sort.count =</span> <span class="ot">FALSE</span>)</a></code></pre></div>
<p><strong>Frequency table of <code>hospital_id</code></strong></p>
<table class="table">
<thead><tr class="header">
@ -557,8 +558,8 @@ Outliers: 15 (unique count: 12)</p> @@ -557,8 +558,8 @@ Outliers: 15 (unique count: 12)</p>
</tbody>
</table>
<p>All classes will be printed into the header (default is <code>FALSE</code> when using markdown like this document). Variables with the new <code>rsi</code> class of this AMR package are actually ordered factors and have three classes (look at <code>Class</code> in the header):</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">septic_patients %&gt;%
<span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(amox, <span class="dt">header =</span> <span class="ot">TRUE</span>)</code></pre></div>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb9-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb9-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(amox, <span class="dt">header =</span> <span class="ot">TRUE</span>)</a></code></pre></div>
<p><strong>Frequency table of <code>amox</code></strong><br>
Class: factor &gt; ordered &gt; rsi (numeric)<br>
Levels: S &lt; I &lt; R<br>
@ -606,8 +607,8 @@ Unique: 3</p> @@ -606,8 +607,8 @@ Unique: 3</p>
<h2 class="hasAnchor">
<a href="#frequencies-of-dates" class="anchor"></a>Frequencies of dates</h2>
<p>Frequencies of dates will show the oldest and newest date in the data, and the amount of days between them:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">septic_patients %&gt;%
<span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(date, <span class="dt">nmax =</span> <span class="dv">5</span>, <span class="dt">header =</span> <span class="ot">TRUE</span>)</code></pre></div>
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb10-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb10-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(date, <span class="dt">nmax =</span> <span class="dv">5</span>, <span class="dt">header =</span> <span class="ot">TRUE</span>)</a></code></pre></div>
<p><strong>Frequency table of <code>date</code></strong><br>
Class: Date (numeric)<br>
Length: 2,000 (of which NA: 0 = 0.00%)<br>
@ -673,11 +674,11 @@ Median: 31 July 2009 (47.39%)</p> @@ -673,11 +674,11 @@ Median: 31 July 2009 (47.39%)</p>
<h2 class="hasAnchor">
<a href="#assigning-a-frequency-table-to-an-object" class="anchor"></a>Assigning a frequency table to an object</h2>
<p>A frequency table is actaually a regular <code>data.frame</code>, with the exception that it contains an additional class.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">my_df &lt;-<span class="st"> </span>septic_patients %&gt;%<span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(age)
<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/class">class</a></span>(my_df)</code></pre></div>
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb11-1" data-line-number="1">my_df &lt;-<span class="st"> </span>septic_patients <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(age)</a>
<a class="sourceLine" id="cb11-2" data-line-number="2"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/class">class</a></span>(my_df)</a></code></pre></div>
<p>[1] “frequency_tbl” “data.frame”</p>
<p>Because of this additional class, a frequency table prints like the examples above. But the object itself contains the complete table without a row limitation:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/dim">dim</a></span>(my_df)</code></pre></div>
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb12-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/dim">dim</a></span>(my_df)</a></code></pre></div>
<p>[1] 74 5</p>
</div>
<div id="additional-parameters" class="section level2">
@ -688,8 +689,8 @@ Median: 31 July 2009 (47.39%)</p> @@ -688,8 +689,8 @@ Median: 31 July 2009 (47.39%)</p>
<a href="#parameter-na-rm" class="anchor"></a>Parameter <code>na.rm</code>
</h3>
<p>With the <code>na.rm</code> parameter (defaults to <code>TRUE</code>, but they will always be shown into the header), you can include <code>NA</code> values in the frequency table:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">septic_patients %&gt;%
<span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(amox, <span class="dt">na.rm =</span> <span class="ot">FALSE</span>)</code></pre></div>
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb13-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb13-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(amox, <span class="dt">na.rm =</span> <span class="ot">FALSE</span>)</a></code></pre></div>
<p><strong>Frequency table of <code>amox</code></strong></p>
<table class="table">
<thead><tr class="header">
@ -741,8 +742,8 @@ Median: 31 July 2009 (47.39%)</p> @@ -741,8 +742,8 @@ Median: 31 July 2009 (47.39%)</p>
<a href="#parameter-row-names" class="anchor"></a>Parameter <code>row.names</code>
</h3>
<p>The default frequency tables shows row indices. To remove them, use <code>row.names = FALSE</code>:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">septic_patients %&gt;%
<span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(hospital_id, <span class="dt">row.names =</span> <span class="ot">FALSE</span>)</code></pre></div>
<div class="sourceCode" id="cb14"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb14-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb14-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(hospital_id, <span class="dt">row.names =</span> <span class="ot">FALSE</span>)</a></code></pre></div>
<p><strong>Frequency table of <code>hospital_id</code></strong></p>
<table class="table">
<thead><tr class="header">
@ -789,8 +790,8 @@ Median: 31 July 2009 (47.39%)</p> @@ -789,8 +790,8 @@ Median: 31 July 2009 (47.39%)</p>
<a href="#parameter-markdown" class="anchor"></a>Parameter <code>markdown</code>
</h3>
<p>The <code>markdown</code> parameter is <code>TRUE</code> at default in non-interactive sessions, like in reports created with R Markdown. This will always print all rows, unless <code>nmax</code> is set.</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">septic_patients %&gt;%
<span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(hospital_id, <span class="dt">markdown =</span> <span class="ot">TRUE</span>)</code></pre></div>
<div class="sourceCode" id="cb15"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb15-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb15-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(hospital_id, <span class="dt">markdown =</span> <span class="ot">TRUE</span>)</a></code></pre></div>
<p><strong>Frequency table of <code>hospital_id</code></strong></p>
<table class="table">
<thead><tr class="header">

1
docs/articles/mo_property.html

@ -171,6 +171,7 @@ @@ -171,6 +171,7 @@
<h1>How to get properties of a microorganism</h1>
<h4 class="author">Matthijs S. Berends</h4>
<h4 class="date">08 January 2019</h4>
<div class="hidden name"><code>mo_property.Rmd</code></div>

11
docs/extra.css

@ -59,7 +59,7 @@ a pre[href], a pre[href]:hover, a pre[href]:focus { @@ -59,7 +59,7 @@ a pre[href], a pre[href]:hover, a pre[href]:focus {
/* syntax font */
pre, code {
font-family: 'Courier New';
font-family: 'Courier New', monospace;
font-size: 100% !important;
font-weight: bold;
background-color: transparent;
@ -102,6 +102,15 @@ help { @@ -102,6 +102,15 @@ help {
display: none;
}
/* Date of vignettes */
.template-article .date:before {
content: 'Last updated: ';
}
.template-article .date {
font-size: 14px;
padding-top: 40px;
}
/* more space between icon and text in top menu */
#navbar .fa,
#navbar .fab,

2
docs/extra.js

@ -38,3 +38,5 @@ $( document ).ready(function() { @@ -38,3 +38,5 @@ $( document ).ready(function() {
// Edit title of manual
$('.template-reference-index h1').text('Manual');
});
$('head').append("<!-- Matomo --><script type='text/javascript'> var _paq = _paq || []; /* tracker methods like 'setCustomDimension' should be called before 'trackPageView' */ _paq.push(['setDomains', ['*.msberends.gitlab.io/AMR','*.msberends.github.io/AMR']]); _paq.push(['enableCrossDomainLinking']); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u='https://analyse.uscloud.nl/'; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', '3']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })();</script><!-- End Matomo Code -->");

26
docs/index.html

@ -215,7 +215,7 @@ @@ -215,7 +215,7 @@
<h3 class="hasAnchor">
<a href="#get-this-package" class="anchor"></a>Get this package</h3>
<p>This package is available on the official R network (CRAN). Install this package in R with:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/install.packages">install.packages</a></span>(<span class="st">"AMR"</span>)</code></pre></div>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/install.packages">install.packages</a></span>(<span class="st">"AMR"</span>)</a></code></pre></div>
<p>It will be downloaded and installed automatically.</p>
</div>
<div id="get-started" class="section level3">
@ -231,17 +231,17 @@ @@ -231,17 +231,17 @@
<p>All (sub)species from <strong>the taxonomic kingdoms Bacteria, Fungi and Protozoa are included in this package</strong>, as well as all previously accepted names known to ITIS. Furthermore, the responsible authors and year of publication are available. This allows users to use authoritative taxonomic information for their data analysis on any microorganism, not only human pathogens. It also helps to quickly determine the Gram stain of bacteria, since all bacteria are classified into subkingdom Negibacteria or Posibacteria. ITIS is a partnership of U.S., Canadian, and Mexican agencies and taxonomic specialists.</p>
<p>The <code>AMR</code> package basically does four important things:</p>
<ol>
<li>It <strong>cleanses existing data</strong>, by transforming it to reproducible and profound <em>classes</em>, making the most efficient use of R. These functions all use artificial intelligence to guess results that you would expect:</li>
</ol>
<li>
<p>It <strong>cleanses existing data</strong>, by transforming it to reproducible and profound <em>classes</em>, making the most efficient use of R. These functions all use artificial intelligence to guess results that you would expect:</p>
<ul>
<li>Use <code><a href="reference/as.mo.html">as.mo()</a></code> to get an ID of a microorganism. The IDs are human readable for the trained eye - the ID of <em>Klebsiella pneumoniae</em> is “B_KLBSL_PNE” (B stands for Bacteria) and the ID of <em>S. aureus</em> 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” and “esccol”. Even <code><a href="reference/as.mo.html">as.mo("MRSA")</a></code> will return the ID of <em>S. aureus</em>. Moreover, it can group all coagulase negative and positive <em>Staphylococci</em>, and can transform <em>Streptococci</em> into Lancefield groups. To find bacteria based on your input, it uses Artificial Intelligence to look up values in the included ITIS data, consisting of more than 18,000 microorganisms.</li>
<li>Use <code><a href="reference/as.rsi.html">as.rsi()</a></code> 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 “&lt;=0.002; S” (combined MIC/RSI) will result in “S”.</li>
<li>Use <code><a href="reference/as.mic.html">as.mic()</a></code> to cleanse your MIC values. It produces a so-called factor (called <em>ordinal</em> in SPSS) with valid MIC values as levels. A value like “&lt;=0.002; S” (combined MIC/RSI) will result in “&lt;=0.002”.</li>
<li>Use <code><a href="reference/as.atc.html">as.atc()</a></code> to get the ATC code of an antibiotic as defined by the WHO. This package contains a database with most LIS codes, official names, DDDs and even trade names of antibiotics. For example, the values “Furabid”, “Furadantin”, “nitro” all return the ATC code of Nitrofurantoine.</li>
</ul>
<ol>
<li>It <strong>enhances existing data</strong> and <strong>adds new data</strong> from data sets included in this package.</li>
</ol>
</li>
<li>
<p>It <strong>enhances existing data</strong> and <strong>adds new data</strong> from data sets included in this package.</p>
<ul>
<li>Use <code><a href="reference/eucast_rules.html">eucast_rules()</a></code> to apply <a href="http://www.eucast.org/expert_rules_and_intrinsic_resistance/">EUCAST expert rules to isolates</a>.</li>
<li>Use <code><a href="reference/first_isolate.html">first_isolate()</a></code> to identify the first isolates of every patient <a href="https://clsi.org/standards/products/microbiology/documents/m39/">using guidelines from the CLSI</a> (Clinical and Laboratory Standards Institute).
@ -253,9 +253,9 @@ @@ -253,9 +253,9 @@
<li>The data set <code>microorganisms</code> 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 <code><a href="reference/mo_property.html">mo_genus()</a></code>, <code><a href="reference/mo_property.html">mo_family()</a></code>, <code><a href="reference/mo_property.html">mo_gramstain()</a></code> or even <code><a href="reference/mo_property.html">mo_phylum()</a></code>. As they use <code><a href="reference/as.mo.html">as.mo()</a></code> internally, they also use artificial intelligence. For example, <code><a href="reference/mo_property.html">mo_genus("MRSA")</a></code> and <code><a href="reference/mo_property.html">mo_genus("S. aureus")</a></code> will both return <code>"Staphylococcus"</code>. 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.</li>
<li>The data set <code>antibiotics</code> 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 <code><a href="reference/ab_property.html">ab_name()</a></code> and <code><a href="reference/ab_property.html">ab_tradenames()</a></code> to look up values. The <code>ab_*</code> functions use <code><a href="reference/as.atc.html">as.atc()</a></code> internally so they support AI to guess your expected result. For example, <code><a href="reference/ab_property.html">ab_name("Fluclox")</a></code>, <code><a href="reference/ab_property.html">ab_name("Floxapen")</a></code> and <code><a href="reference/ab_property.html">ab_name("J01CF05")</a></code> will all return <code>"Flucloxacillin"</code>. These functions can again be used to add new variables to your data.</li>
</ul>
<ol>
<li>It <strong>analyses the data</strong> with convenient functions that use well-known methods.</li>
</ol>
</li>
<li>
<p>It <strong>analyses the data</strong> with convenient functions that use well-known methods.</p>
<ul>
<li>Calculate the resistance (and even co-resistance) of microbial isolates with the <code><a href="reference/portion.html">portion_R()</a></code>, <code><a href="reference/portion.html">portion_IR()</a></code>, <code><a href="reference/portion.html">portion_I()</a></code>, <code><a href="reference/portion.html">portion_SI()</a></code> and <code><a href="reference/portion.html">portion_S()</a></code> functions. Similarly, the <em>number</em> of isolates can be determined with the <code><a href="reference/count.html">count_R()</a></code>, <code><a href="reference/count.html">count_IR()</a></code>, <code><a href="reference/count.html">count_I()</a></code>, <code><a href="reference/count.html">count_SI()</a></code> and <code><a href="reference/count.html">count_S()</a></code> functions. All these functions can be used with the <code>dplyr</code> package (e.g. in conjunction with <code>summarise()</code>)</li>
<li>Plot AMR results with <code><a href="reference/ggplot_rsi.html">geom_rsi()</a></code>, a function made for the <code>ggplot2</code> package</li>
@ -263,9 +263,9 @@ @@ -263,9 +263,9 @@
<li>Conduct descriptive statistics to enhance base R: calculate <code><a href="reference/kurtosis.html">kurtosis()</a></code>, <code><a href="reference/skewness.html">skewness()</a></code> and create frequency tables with <code><a href="reference/freq.html">freq()</a></code>
</li>
</ul>
<ol>
<li>It <strong>teaches the user</strong> how to use all the above actions.</li>
</ol>
</li>
<li>
<p>It <strong>teaches the user</strong> how to use all the above actions.</p>
<ul>
<li>The package contains extensive help pages with many examples.</li>
<li>It also contains an example data set called <code>septic_patients</code>. This data set contains:
@ -276,6 +276,8 @@ @@ -276,6 +276,8 @@
</ul>
</li>
</ul>
</li>
</ol>
<hr>
<p><a href="https://www.rug.nl"><img src="./logo_rug.png" height="60px"></a> <a href="https://www.umcg.nl"><img src="./logo_umcg.png" height="60px"></a> <a href="https://www.certe.nl"><img src="./logo_certe.png" height="60px"></a> <a href="http://www.eurhealth-1health.eu"><img src="./logo_eh1h.png" height="60px"></a> <a href="http://www.eurhealth-1health.eu"><img src="./logo_interreg.png" height="60px"></a></p>
</div>

214
docs/news/index.html

@ -222,27 +222,48 @@ @@ -222,27 +222,48 @@
<ul>
<li>
<strong>BREAKING</strong>: removed deprecated functions, parameters and references to ‘bactid’. Use <code><a href="../reference/as.mo.html">as.mo()</a></code> to identify an MO code.</li>
<li>New website: <a href="https://msberends.gitlab.io/AMR" class="uri">https://msberends.gitlab.io/AMR</a> (built with the great <a href="https://pkgdown.r-lib.org/"><code>pkgdown</code></a>)</li>
<li>New website: <a href="https://msberends.gitlab.io/AMR" class="uri">https://msberends.gitlab.io/AMR</a> (built with the great <a href="https://pkgdown.r-lib.org/"><code>pkgdown</code></a>)
<ul>
<li>Contains the complete manual of this package and all of its functions with an explanation of their parameters</li>
<li>Contains a comprehensive tutorial about how to conduct antimicrobial resistance analysis</li>
</ul>
</li>
<li>Support for <a href="https://dplyr.tidyverse.org"><code>dplyr</code></a> version 0.8.0</li>
<li>Function <code>guess_ab</code> to find an antibiotic column in a table</li>
<li>Function <code><a href="../reference/mo_failures.html">mo_failures()</a></code> to review values that could not be coerced to a valid MO code, using <code><a href="../reference/as.mo.html">as.mo()</a></code>. This latter function will now only show a maximum of 25 uncoerced values.</li>
<li>Function <code><a href="../reference/mo_renamed.html">mo_renamed()</a></code> to get a list of all returned values from <code><a href="../reference/as.mo.html">as.mo()</a></code> that have had taxonomic renaming</li>
<li>Function <code><a href="../reference/age.html">age()</a></code> to calculate the (patients) age in years</li>
<li>Function <code><a href="../reference/age_groups.html">age_groups()</a></code> to split ages into custom or predefined groups (like children or elderly). This allows for easier demographic antimicrobial resistance analysis per age group.</li>
<li>Functions <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code> and <code><a href="../reference/first_isolate.html">filter_first_weighted_isolate()</a></code> to shorten and fasten filtering on data sets with antimicrobial results, e.g.: <code>r septic_patients %&gt;% filter_first_isolate() # or filter_first_isolate(septic_patients)</code> is equal to: <code>r septic_patients %&gt;% mutate(only_firsts = first_isolate(septic_patients, ...)) %&gt;% filter(only_firsts == TRUE) %&gt;% select(-only_firsts)</code>
</li>
<li>New vignettes about how to conduct AMR analysis, predict antimicrobial resistance, use the <em>G</em>-test and more. These are also available (and even easier readable) on our website: <a href="https://msberends.gitlab.io/AMR" class="uri">https://msberends.gitlab.io/AMR</a>.</li>
<li>
<p>Functions <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code> and <code><a href="../reference/first_isolate.html">filter_first_weighted_isolate()</a></code> to shorten and fasten filtering on data sets with antimicrobial results, e.g.:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span><span class="st"> </span><span class="kw"><a href="../reference/first_isolate.html">filter_first_isolate</a></span>()</a>
<a class="sourceLine" id="cb1-2" data-line-number="2"><span class="co"># or</span></a>
<a class="sourceLine" id="cb1-3" data-line-number="3"><span class="kw"><a href="../reference/first_isolate.html">filter_first_isolate</a></span>(septic_patients)</a></code></pre></div>
<p>is equal to:</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb2-2" data-line-number="2"><span class="st"> </span><span class="kw">mutate</span>(<span class="dt">only_firsts =</span> <span class="kw"><a href="../reference/first_isolate.html">first_isolate</a></span>(septic_patients, ...)) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb2-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="https://www.rdocumentation.org/packages/stats/topics/filter">filter</a></span>(only_firsts <span class="op">==</span><span class="st"> </span><span class="ot">TRUE</span>) <span class="op">%&gt;%</span></a>
<a class="sourceLine" id="cb2-4" data-line-number="4"><span class="st"> </span><span class="kw">select</span>(<span class="op">-</span>only_firsts)</a></code></pre></div>
</li>
<li><p>New vignettes about how to conduct AMR analysis, predict antimicrobial resistance, use the <em>G</em>-test and more. These are also available (and even easier readable) on our website: <a href="https://msberends.gitlab.io/AMR" class="uri">https://msberends.gitlab.io/AMR</a>.</p></li>
</ul>
</div>
<div id="changed" class="section level4">
<h4 class="hasAnchor">
<a href="#changed" class="anchor"></a>Changed</h4>
<ul>
<li>Function <code><a href="../reference/AMR-deprecated.html">guess_mo()</a></code> is now deprecated in favour of <code><a href="../reference/as.mo.html">as.mo()</a></code> and will be remover in future versions</li>
<li>Fixed a critical bug in <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code> where some rules that depend on previous applied rules would not be applied adequately</li>
<li>Improvements for <code><a href="../reference/as.mo.html">as.mo()</a></code>:</li>
<li>Function <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code>:
<ul>
<li>Updated EUCAST Clinical breakpoints to <a href="http://www.eucast.org/clinical_breakpoints/">version 9.0 of 1 January 2019</a>
</li>
<li>Fixed a critical bug where some rules that depend on previous applied rules would not be applied adequately</li>
<li>Emphasised in manual that penicillin is meant as benzylpenicillin (ATC <a href="https://www.whocc.no/atc_ddd_index/?code=J01CE01">J01CE01</a>)</li>
</ul>
</li>
<li>Function <code><a href="../reference/AMR-deprecated.html">guess_mo()</a></code> is now deprecated in favour of <code><a href="../reference/as.mo.html">as.mo()</a></code> and will be removed in future versions</li>
<li>Improvements for <code><a href="../reference/as.mo.html">as.mo()</a></code>:
<ul>
<li>Fix for vector containing only empty values</li>
<li>Finds better results when input is in other languages</li>
<li>Better handling for subspecies</li>
<li>Better handling for <em>Salmonellae</em>
@ -251,12 +272,17 @@ @@ -251,12 +272,17 @@
<li>Manual now contains more info about the algorithms</li>
<li>Progress bar will be shown when it takes more than 3 seconds to get results</li>
<li>Support for formatted console text</li>
<li>Function <code><a href="../reference/first_isolate.html">first_isolate()</a></code>:</li>
</ul>
</li>
<li>Function <code><a href="../reference/first_isolate.html">first_isolate()</a></code>:
<ul>
<li>Fixed a bug where distances between dates would not be calculated right - in the <code>septic_patients</code> data set this yielded a difference of 0.15% more isolates</li>
<li>Will now use a column named like “patid” for the patient ID (parameter <code>col_patientid</code>), when this parameter was left blank</li>
<li>Will now use a column named like “key(…)ab” or “key(…)antibiotics” for the key antibiotics (parameter <code>col_keyantibiotics()</code>), when this parameter was left blank</li>
<li>Removed parameter <code>output_logical</code>, the function will now always return a logical value</li>
<li>Renamed parameter <code>filter_specimen</code> to <code>specimen_group</code>, although using <code>filter_specimen</code> will still work</li>
</ul>
</li>
<li>A note to the manual pages of the <code>portion</code> functions, that low counts can influence the outcome and that the <code>portion</code> functions may camouflage this, since they only return the portion (albeit being dependent on the <code>minimum</code> parameter)</li>
<li>Function <code><a href="../reference/mo_property.html">mo_taxonomy()</a></code> now contains the kingdom too</li>
<li>Reduce false positives for <code><a href="../reference/as.rsi.html">is.rsi.eligible()</a></code>
@ -265,7 +291,8 @@ @@ -265,7 +291,8 @@
</li>
<li>Small text updates to summaries of class <code>rsi</code> and <code>mic</code>
</li>
<li>Frequency tables (<code><a href="../reference/freq.html">freq()</a></code> function):</li>
<li>Frequency tables (<code><a href="../reference/freq.html">freq()</a></code> function):
<ul>
<li>Header info is now available as a list, with the <code>header</code> function</li>
<li>Added header info for class <code>mo</code> to show unique count of families, genera and species</li>
<li>Now honours the <code>decimal.mark</code> setting, which just like <code>format</code> defaults to <code><a href="https://www.rdocumentation.org/packages/base/topics/options">getOption("OutDec")</a></code>
@ -275,6 +302,8 @@ @@ -275,6 +302,8 @@
</li>
<li>New parameter <code>droplevels</code> to exclude empty factor levels when input is a factor</li>
<li>Factor levels will be in header when present in input data</li>
</ul>
</li>
<li>Function <code><a href="../reference/ggplot_rsi.html">scale_y_percent()</a></code> now contains the <code>limits</code> parameter</li>
<li>Automatic parameter filling for <code><a href="../reference/mdro.html">mdro()</a></code>, <code><a href="../reference/key_antibiotics.html">key_antibiotics()</a></code> and <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code>
</li>
@ -316,7 +345,8 @@ @@ -316,7 +345,8 @@
</li>
<li>
<code>EUCAST_rules</code> was renamed to <code>eucast_rules</code>, the old function still exists as a deprecated function</li>
<li>Big changes to the <code>eucast_rules</code> function:</li>
<li>Big changes to the <code>eucast_rules</code> function:
<ul>
<li>Now also applies rules from the EUCAST ‘Breakpoint tables for bacteria’, version 8.1, 2018, <a href="http://www.eucast.org/clinical_breakpoints/" class="uri">http://www.eucast.org/clinical_breakpoints/</a> (see Source of the function)</li>
<li>New parameter <code>rules</code> to specify which rules should be applied (expert rules, breakpoints, others or all)</li>
<li>New parameter <code>verbose</code> which can be set to <code>TRUE</code> to get very specific messages about which columns and rows were affected</li>
@ -325,11 +355,18 @@ @@ -325,11 +355,18 @@
<li>Data set <code>septic_patients</code> now reflects these changes</li>
<li>Added parameter <code>pipe</code> for piperacillin (J01CA12), also to the <code>mdro</code> function</li>
<li>Small fixes to EUCAST clinical breakpoint rules</li>
</ul>
</li>
<li>Added column <code>kingdom</code> to the microorganisms data set, and function <code>mo_kingdom</code> to look up values</li>
<li>Tremendous speed improvement for <code>as.mo</code> (and subsequently all <code>mo_*</code> functions), as empty values wil be ignored <em>a priori</em>
</li>
<li>Fewer than 3 characters as input for <code>as.mo</code> will return NA</li>
<li>Function <code>as.mo</code> (and all <code>mo_*</code> wrappers) now supports genus abbreviations with “species” attached <code>r as.mo("E. species") # B_ESCHR mo_fullname("E. spp.") # "Escherichia species" as.mo("S. spp") # B_STPHY mo_fullname("S. species") # "Staphylococcus species"</code>
<li>
<p>Function <code>as.mo</code> (and all <code>mo_*</code> wrappers) now supports genus abbreviations with “species” attached</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" data-line-number="1"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"E. species"</span>) <span class="co"># B_ESCHR</span></a>
<a class="sourceLine" id="cb3-2" data-line-number="2"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"E. spp."</span>) <span class="co"># "Escherichia species"</span></a>
<a class="sourceLine" id="cb3-3" data-line-number="3"><span class="kw"><a href="../reference/as.mo.html">as.mo</a></span>(<span class="st">"S. spp"</span>) <span class="co"># B_STPHY</span></a>
<a class="sourceLine" id="cb3-4" data-line-number="4"><span class="kw"><a href="../reference/mo_property.html">mo_fullname</a></span>(<span class="st">"S. species"</span>) <span class="co"># "Staphylococcus species"</span></a></code></pre></div>
</li>
<li>Added parameter <code>combine_IR</code> (TRUE/FALSE) to functions <code>portion_df</code> and <code>count_df</code>, to indicate that all values of I and R must be merged into one, so the output only consists of S vs. IR (susceptible vs. non-susceptible)</li>
<li>Fix for <code>portion_*(..., as_percent = TRUE)</code> when minimal number of isolates would not be met</li>
@ -338,18 +375,19 @@ @@ -338,18 +375,19 @@
<li>Using <code>portion_*</code> functions now throws a warning when total available isolate is below parameter <code>minimum</code>
</li>
<li>Functions <code>as.mo</code>, <code>as.rsi</code>, <code>as.mic</code>, <code>as.atc</code> and <code>freq</code> will not set package name as attribute anymore</li>
<li>Frequency tables - <code><a href="../reference/freq.html">freq()</a></code>:</li>
<li>Frequency tables - <code><a href="../reference/freq.html">freq()</a></code>:
<ul>
<li>
<p>Support for grouping variables, test with:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">septic_patients %&gt;%<span class="st"> </span>
<span class="st"> </span><span class="kw">group_by</span>(hospital_id) %&gt;%<span class="st"> </span>
<span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(gender)</code></pre></div>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb4-2" data-line-number="2"><span class="st"> </span><span class="kw">group_by</span>(hospital_id) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb4-3" data-line-number="3"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(gender)</a></code></pre></div>
</li>
<li>
<p>Support for (un)selecting columns:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r">septic_patients %&gt;%<span class="st"> </span>
<span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(hospital_id) %&gt;%<span class="st"> </span>
<span class="st"> </span><span class="kw">select</span>(-count, -cum_count) <span class="co"># only get item, percent, cum_percent</span></code></pre></div>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" data-line-number="1">septic_patients <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb5-2" data-line-number="2"><span class="st"> </span><span class="kw"><a href="../reference/freq.html">freq</a></span>(hospital_id) <span class="op">%&gt;%</span><span class="st"> </span></a>
<a class="sourceLine" id="cb5-3" data-line-number="3"><span class="st"> </span><span class="kw">select</span>(<span class="op">-</span>count, <span class="op">-</span>cum_count) <span class="co"># only get item, percent, cum_percent</span></a></code></pre></div>
</li>
<li>Check for <code><a href="https://www.rdocumentation.org/packages/hms/topics/hms">hms::is.hms</a></code>
</li>
@ -360,6 +398,8 @@ @@ -360,6 +398,8 @@
<li>New parameter <code>na</code>, to choose which character to print for empty values</li>
<li>New parameter <code>header</code> to turn the header info off (default when <code>markdown = TRUE</code>)</li>
<li>New parameter <code>title</code> to manually setbthe title of the frequency table</li>
</ul>
</li>
<li>
<code>first_isolate</code> now tries to find columns to use as input when parameters are left blank</li>
<li>Improvements for MDRO algorithm (function <code>mdro</code>)</li>
@ -371,7 +411,8 @@ @@ -371,7 +411,8 @@
</li>
<li>
<code>ggplot_rsi</code> and <code>scale_y_percent</code> have <code>breaks</code> parameter</li>
<li>AI improvements for <code>as.mo</code>:</li>
<li>AI improvements for <code>as.mo</code>:
<ul>
<li>
<code>"CRS"</code> -&gt; <em>Stenotrophomonas maltophilia</em>
</li>
@ -384,6 +425,8 @@ @@ -384,6 +425,8 @@
<li>
<code>"MSSE"</code> -&gt; <em>Staphylococcus epidermidis</em>
</li>
</ul>
</li>
<li>Fix for <code>join</code> functions</li>
<li>Speed improvement for <code>is.rsi.eligible</code>, now 15-20 times faster</li>
<li>In <code>g.test</code>, when <code><a href="https://www.rdocumentation.org/packages/base/topics/sum">sum(x)</a></code> is below 1000 or any of the expected values is below 5, Fisher’s Exact Test will be suggested</li>
@ -412,7 +455,8 @@ @@ -412,7 +455,8 @@
<a href="#new-2" class="anchor"></a>New</h4>
<ul>
<li>The data set <code>microorganisms</code> now contains <strong>all microbial taxonomic data from ITIS</strong> (kingdoms Bacteria, Fungi and Protozoa), the Integrated Taxonomy Information System, available via <a href="https://itis.gov" class="uri">https://itis.gov</a>. The data set now contains more than 18,000 microorganisms with all known bacteria, fungi and protozoa according ITIS with genus, species, subspecies, family, order, class, phylum and subkingdom. The new data set <code>microorganisms.old</code> contains all previously known taxonomic names from those kingdoms.</li>
<li>New functions based on the existing function <code>mo_property</code>:</li>
<li>New functions based on the existing function <code>mo_property</code>:
<ul>
<li>Taxonomic names: <code>mo_phylum</code>, <code>mo_class</code>, <code>mo_order</code>, <code>mo_family</code>, <code>mo_genus</code>, <code>mo_species</code>, <code>mo_subspecies</code>
</li>
<li>Semantic names: <code>mo_fullname</code>, <code>mo_shortname</code>
@ -422,22 +466,52 @@ @@ -422,22 +466,52 @@
<li>Author and year: <code>mo_ref</code>
</li>
</ul>
<p>They also come with support for German, Dutch, French, Italian, Spanish and Portuguese: <code>r mo_gramstain("E. coli") # [1] "Gram negative" mo_gramstain("E. coli", language = "de") # German # [1] "Gramnegativ" mo_gramstain("E. coli", language = "es") # Spanish # [1] "Gram negativo" mo_fullname("S. group A", language = "pt") # Portuguese # [1] "Streptococcus grupo A"</code></p>
<p>Furthermore, former taxonomic names will give a note about the current taxonomic name: <code>r mo_gramstain("Esc blattae") # Note: 'Escherichia blattae' (Burgess et al., 1973) was renamed 'Shimwellia blattae' (Priest and Barker, 2010) # [1] "Gram negative"</code></p>
<p>They also come with support for German, Dutch, French, Italian, Spanish and Portuguese:</p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb6-1" data-line-number="1"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"E. coli"</span>)</a>
<a class="sourceLine" id="cb6-2" data-line-number="2"><span class="co"># [1] "Gram negative"</span></a>
<a class="sourceLine" id="cb6-3" data-line-number="3"><span class="kw"><a href="../reference/mo_property.html">mo_gramstain</a></span>(<span class="st">"E. coli"</span>, <span class="dt">language =</span> <span class="st">"de"</span>) <span class="co"># German</span></a>
<a class="sourceLine" id="cb6-4" data-line-number="4"><span class="co"># [1] "Gramnegativ"</span></a>
<