Browse Source

new website, freq updates

new-mo-algorithm
parent
commit
92a32b62a7
  1. 20
      .Rbuildignore
  2. 3
      .gitignore
  3. 3
      .gitlab-ci.yml
  4. 12
      DESCRIPTION
  5. 5
      NAMESPACE
  6. 33
      NEWS.md
  7. 346
      R/freq.R
  8. 19
      R/mic.R
  9. 13
      R/misc.R
  10. 36
      R/rsi.R
  11. 2
      README.md
  12. 110
      _pkgdown.yml
  13. 1
      docs/CNAME
  14. 102
      docs/LICENSE-text.html
  15. BIN
      docs/apple-touch-icon-120x120.png
  16. BIN
      docs/apple-touch-icon-152x152.png
  17. BIN
      docs/apple-touch-icon-180x180.png
  18. BIN
      docs/apple-touch-icon-60x60.png
  19. BIN
      docs/apple-touch-icon-76x76.png
  20. BIN
      docs/apple-touch-icon.png
  21. 165
      docs/articles/AMR.html
  22. 1434
      docs/articles/freq.html
  23. 104
      docs/articles/index.html
  24. 224
      docs/authors.html
  25. 0
      docs/docsearch.css
  26. 0
      docs/docsearch.js
  27. 94
      docs/docsearch.json
  28. 54
      docs/extra.css
  29. 3
      docs/extra.js
  30. BIN
      docs/favicon-16x16.png
  31. BIN
      docs/favicon-32x32.png
  32. BIN
      docs/favicon.ico
  33. 250
      docs/index.html
  34. 0
      docs/link.svg
  35. 0
      docs/logo.svg
  36. 0
      docs/logo_certe.png
  37. 0
      docs/logo_eh1h.png
  38. 0
      docs/logo_interreg.png
  39. 0
      docs/logo_rug.png
  40. 0
      docs/logo_umcg.png
  41. 786
      docs/news/index.html
  42. 0
      docs/pkgdown.css
  43. 0
      docs/pkgdown.js
  44. 10
      docs/pkgdown.yml
  45. 101
      docs/reference/AMR-deprecated.html
  46. 101
      docs/reference/AMR.html
  47. 110
      docs/reference/ab_property.html
  48. 129
      docs/reference/abname.html
  49. 101
      docs/reference/age.html
  50. 0
      docs/reference/age_groups-1.png
  51. 145
      docs/reference/age_groups.html
  52. 101
      docs/reference/antibiotics.html
  53. 128
      docs/reference/as.atc.html
  54. 0
      docs/reference/as.mic-1.png
  55. 128
      docs/reference/as.mic.html
  56. 159
      docs/reference/as.mo.html
  57. 0
      docs/reference/as.rsi-1.png
  58. 0
      docs/reference/as.rsi-2.png
  59. 271
      docs/reference/as.rsi.html
  60. 128
      docs/reference/atc_property.html
  61. 173
      docs/reference/count.html
  62. 218
      docs/reference/eucast_rules.html
  63. 0
      docs/reference/figures/clipboard_copy.png
  64. 0
      docs/reference/figures/clipboard_paste.png
  65. 0
      docs/reference/figures/clipboard_rsi.png
  66. 0
      docs/reference/figures/combi_therapy_2.png
  67. 0
      docs/reference/figures/combi_therapy_3.png
  68. 0
      docs/reference/figures/itis_logo.jpg
  69. 0
      docs/reference/figures/logo.png
  70. 0
      docs/reference/figures/logo.svg
  71. BIN
      docs/reference/figures/logo_certe.png
  72. BIN
      docs/reference/figures/logo_eh1h.png
  73. BIN
      docs/reference/figures/logo_interreg.png
  74. BIN
      docs/reference/figures/logo_rug.png
  75. BIN
      docs/reference/figures/logo_umcg.png
  76. 0
      docs/reference/figures/mic_example.png
  77. 0
      docs/reference/figures/mono_therapy.png
  78. 0
      docs/reference/figures/plus.png
  79. 0
      docs/reference/figures/rsi_example1.png
  80. 0
      docs/reference/figures/rsi_example2.png
  81. 0
      docs/reference/figures/rsi_example3.png
  82. 0
      docs/reference/figures/rsi_example4.png
  83. 430
      docs/reference/first_isolate.html
  84. BIN
      docs/reference/freq-1.png
  85. 0
      docs/reference/freq-2.png
  86. 457
      docs/reference/freq.html
  87. 118
      docs/reference/g.test.html
  88. 101
      docs/reference/get_locale.html
  89. 0
      docs/reference/ggplot_rsi-1.png
  90. 0
      docs/reference/ggplot_rsi-2.png
  91. 0
      docs/reference/ggplot_rsi-3.png
  92. 0
      docs/reference/ggplot_rsi-4.png
  93. 0
      docs/reference/ggplot_rsi-5.png
  94. 0
      docs/reference/ggplot_rsi-6.png
  95. 0
      docs/reference/ggplot_rsi-7.png
  96. 132
      docs/reference/ggplot_rsi.html
  97. 304
      docs/reference/index.html
  98. 272
      docs/reference/join.html
  99. 122
      docs/reference/key_antibiotics.html
  100. 101
      docs/reference/kurtosis.html
  101. Some files were not shown because too many files have changed in this diff Show More

20
.Rbuildignore

@ -1,11 +1,17 @@ @@ -1,11 +1,17 @@
^Meta$
^doc$
^CRAN-RELEASE$
^.*\.Rproj$
^\.Rproj\.user$
.travis.yml
appveyor.yml
.gitlab-ci.yml
.zenodo.json
_noinclude
^\.travis.yml$
^appveyor.yml$
^\.gitlab-ci.yml$
^\.zenodo.json$
^_noinclude$
^cran-comments\.md$
git.sh
public
^git.sh$
^public$
^docs$
^_pkgdown\.yml$
^pkgdown$
^index\.md$

3
.gitignore vendored

@ -1,3 +1,5 @@ @@ -1,3 +1,5 @@
Meta
doc
.Rproj.user
.Rhistory
.RData
@ -13,6 +15,5 @@ _noinclude @@ -13,6 +15,5 @@ _noinclude
*.dll
vignettes/*.R
.DS_Store
^cran-comments\.md$
^CRAN-RELEASE$
git.sh

3
.gitlab-ci.yml

@ -38,7 +38,8 @@ pages: @@ -38,7 +38,8 @@ pages:
- Rscript -e "install.packages(c('pkgdown', 'devtools'), repos = 'https://cran.rstudio.com')"
- Rscript -e "devtools::install_dev_deps(repos = 'https://cran.rstudio.com')"
- Rscript -e "devtools::install(build = TRUE, upgrade = FALSE)"
- R -e "pkgdown::build_site()"
# - R -e "pkgdown::build_favicon()"
- R -e "pkgdown::build_site(examples = FALSE)"
artifacts:
paths:
- public

12
DESCRIPTION

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
Package: AMR
Version: 0.5.0.9007
Date: 2018-12-22
Version: 0.5.0.9008
Date: 2018-12-29
Title: Antimicrobial Resistance Analysis
Authors@R: c(
person(
@ -24,19 +24,19 @@ Authors@R: c( @@ -24,19 +24,19 @@ Authors@R: c(
given = "Corinna",
family = "Glasner",
email = "c.glasner@umcg.nl",
role = "ths",
role = c("aut", "ths"),
comment = c(ORCID = "0000-0003-1241-1328")),
person(
given = c("Alex", "W."),
family = "Friedrich",
email = "alex.friedrich@umcg.nl",
role = "ths",
role = c("aut", "ths"),
comment = c(ORCID = "0000-0003-4881-038X")),
person(
given = c("Bhanu", "N.", "M."),
family = "Sinha",
email = "b.sinha@umcg.nl",
role = "ths",
role = c("aut", "ths"),
comment = c(ORCID = "0000-0003-1634-0010")))
Description: Functions to simplify the analysis and prediction of Antimicrobial
Resistance (AMR) and to work with microbial and antimicrobial properties by
@ -62,7 +62,7 @@ Suggests: @@ -62,7 +62,7 @@ Suggests:
rstudioapi,
testthat (>= 1.0.2)
VignetteBuilder: knitr
URL: https://gitlab.com/msberends/AMR
URL: https://msberends.gitlab.io/AMR, https://gitlab.com/msberends/AMR
BugReports: https://gitlab.com/msberends/AMR/issues
License: GPL-2 | file LICENSE
Encoding: UTF-8

5
NAMESPACE

@ -11,6 +11,8 @@ S3method(as_tibble,frequency_tbl) @@ -11,6 +11,8 @@ S3method(as_tibble,frequency_tbl)
S3method(barplot,mic)
S3method(barplot,rsi)
S3method(diff,frequency_tbl)
S3method(droplevels,mic)
S3method(droplevels,rsi)
S3method(format,frequency_tbl)
S3method(hist,frequency_tbl)
S3method(kurtosis,data.frame)
@ -76,6 +78,7 @@ export(get_locale) @@ -76,6 +78,7 @@ export(get_locale)
export(ggplot_rsi)
export(guess_atc)
export(guess_mo)
export(header)
export(inner_join_microorganisms)
export(interpretive_reading)
export(is.atc)
@ -143,6 +146,8 @@ exportMethods(as_tibble.frequency_tbl) @@ -143,6 +146,8 @@ exportMethods(as_tibble.frequency_tbl)
exportMethods(barplot.mic)
exportMethods(barplot.rsi)
exportMethods(diff.frequency_tbl)
exportMethods(droplevels.mic)
exportMethods(droplevels.rsi)
exportMethods(format.frequency_tbl)
exportMethods(hist.frequency_tbl)
exportMethods(kurtosis)

33
NEWS.md

@ -1,8 +1,11 @@ @@ -1,8 +1,11 @@
# 0.5.0.90xx (latest development version)
# AMR 0.5.0.90xx
**Note: this is the development version, which will eventually be released as AMR 0.6.0.**
#### New
* **BREAKING**: removed deprecated functions, parameters and references to 'bactid'. Use `as.mo` to identify an MO code.
* Support for `dplyr` version 0.8.0
* New website: https://msberends.gitlab.io/AMR (built with the great [`pkgdown`](https://pkgdown.r-lib.org/))
* Contains the complete manual of this package and all of its functions with an explanation of their parameters
* Support for [`dplyr`](https://dplyr.tidyverse.org) version 0.8.0
* Function `mo_failures` to review values that could not be coerced to a valid MO code, using `as.mo`. This latter function will now only show a maximum of 25 uncoerced values.
* Function `mo_renamed` to get a list of all returned values from `as.mo` that have had taxonomic renaming
* Function `age` to calculate the (patients) age in years
@ -13,7 +16,7 @@ @@ -13,7 +16,7 @@
# or
filter_first_isolate(septic_patients)
```
is the same as:
is equal to:
```r
septic_patients %>%
mutate(only_firsts = first_isolate(septic_patients, ...)) %>%
@ -42,21 +45,22 @@ @@ -42,21 +45,22 @@
* Summaries of class `mo` will now return the top 3 and the unique count, e.g. using `summary(mo)`
* Small text updates to summaries of class `rsi` and `mic`
* Frequency tables (`freq` function):
* Header info is now available as a list, with the `header` function
* Added header info for class `mo` to show unique count of families, genera and species
* Now honours the `decimal.mark` setting, which just like `format` defaults to `getOption("OutDec")`
* The new `big.mark` parameter will at default be `","` when `decimal.mark = "."` and `"."` otherwise
* Fix for header text where all observations are `NA`
* New parameter `droplevels` to exclude empty factor levels when input is a factor
* Factor levels will be in header when present
* Function `scale_y_percent` now has the `limits` parameter
* Factor levels will be in header when present in input data
* Function `scale_y_percent` now contains the `limits` parameter
* Automatic parameter filling for `mdro`, `key_antibiotics` and `eucast_rules`
* Updated examples for resistance prediction (`resistance_predict` function)
* Fix for `as.mic` to support more values ending in (several) zeroes
#### Other
* Updated licence text to emphasise GPL 2.0 and that this is an R package.
# 0.5.0 (latest stable release)
**Published on CRAN: 2018-11-30**
# AMR 0.5.0
#### New
* Repository moved to GitLab: https://gitlab.com/msberends/AMR
@ -139,8 +143,7 @@ @@ -139,8 +143,7 @@
* Updated vignettes to comply with README
# 0.4.0
**Published on CRAN: 2018-10-01**
# AMR 0.4.0
#### New
* The data set `microorganisms` now contains **all microbial taxonomic data from ITIS** (kingdoms Bacteria, Fungi and Protozoa), the Integrated Taxonomy Information System, available via https://itis.gov. 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 `microorganisms.old` contains all previously known taxonomic names from those kingdoms.
@ -251,8 +254,7 @@ @@ -251,8 +254,7 @@
#### Other
* More unit tests to ensure better integrity of functions
# 0.3.0
**Published on CRAN: 2018-08-14**
# AMR 0.3.0
#### New
* **BREAKING**: `rsi_df` was removed in favour of new functions `portion_R`, `portion_IR`, `portion_I`, `portion_SI` and `portion_S` to selectively calculate resistance or susceptibility. These functions are 20 to 30 times faster than the old `rsi` function. The old function still works, but is deprecated.
@ -322,8 +324,7 @@ @@ -322,8 +324,7 @@
* Windows: https://ci.appveyor.com/project/msberends/amr
* Added thesis advisors to DESCRIPTION file
# 0.2.0
**Published on CRAN: 2018-05-03**
# AMR 0.2.0
#### New
* Full support for Windows, Linux and macOS
@ -359,8 +360,7 @@ @@ -359,8 +360,7 @@
* Added build tests for Linux and macOS using Travis CI (https://travis-ci.org/msberends/AMR)
* Added line coverage checking using CodeCov (https://codecov.io/gh/msberends/AMR/tree/master/R)
# 0.1.1
**Published on CRAN: 2018-03-14**
# AMR 0.1.1
* `EUCAST_rules` applies for amoxicillin even if ampicillin is missing
* Edited column names to comply with GLIMS, the laboratory information system
@ -368,7 +368,6 @@ @@ -368,7 +368,6 @@
* Renamed 'Daily Defined Dose' to 'Defined Daily Dose'
* Added barplots for `rsi` and `mic` classes
# 0.1.0
**Published on CRAN: 2018-02-22**
# AMR 0.1.0
* First submission to CRAN.

346
R/freq.R

@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
#' @param nmax number of row to print. The default, \code{15}, uses \code{\link{getOption}("max.print.freq")}. Use \code{nmax = 0}, \code{nmax = Inf}, \code{nmax = NULL} or \code{nmax = NA} to print all rows.
#' @param na.rm a logical value indicating whether \code{NA} values should be removed from the frequency table. The header (if set) will always print the amount of \code{NA}s.
#' @param row.names a logical value indicating whether row indices should be printed as \code{1:nrow(x)}
#' @param markdown a logical value indicating whether the frequency table should be printed in markdown format. This will print all rows and is default behaviour in non-interactive R sessions (like when knitting RMarkdown files).
#' @param markdown a logical value indicating whether the frequency table should be printed in markdown format. This will print all rows (except when \code{nmax} is defined) and is default behaviour in non-interactive R sessions (like when knitting RMarkdown files).
#' @param digits how many significant digits are to be used for numeric values in the header (not for the items themselves, that depends on \code{\link{getOption}("digits")})
#' @param quote a logical value indicating whether or not strings should be printed with surrounding quotes
#' @param header a logical value indicating whether an informative header should be printed
@ -36,6 +36,7 @@ @@ -36,6 +36,7 @@
#' @inheritParams base::format
#' @param f a frequency table
#' @param n number of top \emph{n} items to return, use -n for the bottom \emph{n} items. It will include more than \code{n} rows if there are ties.
#' @param property property in header to return this value directly
#' @details Frequency tables (or frequency distributions) are summaries of the distribution of values in a sample. With the `freq` function, you can create univariate frequency tables. Multiple variables will be pasted into one variable, so it forces a univariate distribution. This package also has a vignette available to explain the use of this function further, run \code{browseVignettes("AMR")} to read it.
#'
#' For numeric values of any class, these additional values will all be calculated with \code{na.rm = TRUE} and shown into the header:
@ -309,51 +310,22 @@ frequency_tbl <- function(x, @@ -309,51 +310,22 @@ frequency_tbl <- function(x,
class(x) <- x_class
}
header_txt <- character(0)
markdown_line <- ""
if (markdown == TRUE) {
markdown_line <- "\n"
markdown_line <- " "
}
x_align <- "l"
if (mult.columns > 0) {
header_txt <- header_txt %>% paste0(markdown_line, "Columns: ", mult.columns)
header_list <- list(columns = mult.columns)
} else {
header_txt <- header_txt %>% paste0(markdown_line, "Class: ", class(x) %>% rev() %>% paste(collapse = " > "))
if (!mode(x) %in% class(x)) {
header_txt <- header_txt %>% paste0(silver(paste0(" (", mode(x), ")")))
}
}
if ((length(NAs) + length(x) > 0) > 0) {
na_txt <- paste0(NAs %>% length() %>% format(decimal.mark = decimal.mark, big.mark = big.mark), " = ",
(NAs %>% length() / (NAs %>% length() + x %>% length())) %>% percent(force_zero = TRUE, round = digits, decimal.mark = decimal.mark) %>%
sub("NaN", "0", ., fixed = TRUE))
if (!na_txt %like% "^0 =") {
na_txt <- red(na_txt)
} else {
na_txt <- green(na_txt)
}
na_txt <- paste0("(of which NA: ", na_txt, ")")
} else {
na_txt <- ""
header_list <- list(class = class(x),
mode = mode(x))
}
if (!is.null(levels(x))) {
n_levels <- x %>% levels() %>% length()
n_levels_empty <- n_levels - x %>% droplevels() %>% levels() %>% length()
n_levels_list <- levels(x)
if (n_levels > 5) {
n_levels_list <- c(n_levels_list[1:5], "...")
}
if (is.ordered(x)) {
n_levels_list <- paste0(levels(x), collapse = " < ")
} else {
n_levels_list <- paste0(levels(x), collapse = ", ")
}
header_txt <- header_txt %>% paste0(markdown_line, "\nLevels: ", n_levels_list)
header_list$levels <- levels(x)
header_list$ordered <- is.ordered(x)
# drop levels of non-existing factor values,
# since dplyr >= 0.8.0 does not do this anymore in group_by
if (droplevels == TRUE) {
@ -361,58 +333,45 @@ frequency_tbl <- function(x, @@ -361,58 +333,45 @@ frequency_tbl <- function(x,
}
}
header_txt <- header_txt %>% paste0(markdown_line, "\nLength: ", (NAs %>% length() + x %>% length()) %>% format(decimal.mark = decimal.mark, big.mark = big.mark),
" ", na_txt)
header_txt <- header_txt %>% paste0(markdown_line, "\nUnique: ", x %>% n_distinct() %>% format(decimal.mark = decimal.mark, big.mark = big.mark))
header_list$length <- length(x)
header_list$na_length <- length(NAs)
header_list$unique <- n_distinct(x)
if (NROW(x) > 0 & any(class(x) == "character")) {
header_txt <- header_txt %>% paste0("\n")
header_txt <- header_txt %>% paste0(markdown_line, "\nShortest: ", x %>% base::nchar() %>% base::min(na.rm = TRUE) %>% format(decimal.mark = decimal.mark, big.mark = big.mark))
header_txt <- header_txt %>% paste0(markdown_line, "\nLongest: ", x %>% base::nchar() %>% base::max(na.rm = TRUE) %>% format(decimal.mark = decimal.mark, big.mark = big.mark))
header_list$shortest <- x %>% base::nchar() %>% base::min(na.rm = TRUE)
header_list$longest <- x %>% base::nchar() %>% base::max(na.rm = TRUE)
}
if (NROW(x) > 0 & any(class(x) == "mo")) {
header_txt <- header_txt %>% paste0("\n")
header_txt <- header_txt %>% paste0(markdown_line, "\nFamilies: ", x %>% mo_family() %>% n_distinct() %>% format(decimal.mark = decimal.mark, big.mark = big.mark))
header_txt <- header_txt %>% paste0(markdown_line, "\nGenera: ", x %>% mo_genus() %>% n_distinct() %>% format(decimal.mark = decimal.mark, big.mark = big.mark))
header_txt <- header_txt %>% paste0(markdown_line, "\nSpecies: ", x %>% mo_species() %>% n_distinct() %>% format(decimal.mark = decimal.mark, big.mark = big.mark))
header_list$families <- x %>% mo_family() %>% n_distinct()
header_list$genera <- x %>% mo_genus() %>% n_distinct()
header_list$species <- x %>% mo_species() %>% n_distinct()
}
if (NROW(x) > 0 & any(class(x) == "difftime") & !is.hms(x)) {
header_txt <- header_txt %>% paste0("\n")
header_txt <- header_txt %>% paste(markdown_line, "\nUnits: ", attributes(x)$units)
header_list$units <- attributes(x)$units
x <- as.double(x)
# after this, the numeric header_txt continues
}
if (NROW(x) > 0 & any(class(x) %in% c("double", "integer", "numeric", "raw", "single"))) {
# right align number
Tukey_five <- stats::fivenum(x, na.rm = TRUE)
x_align <- "r"
header_txt <- header_txt %>% paste0("\n")
header_txt <- header_txt %>% paste(markdown_line, "\nMean: ", x %>% base::mean(na.rm = TRUE) %>% format(digits = digits, decimal.mark = decimal.mark, big.mark = big.mark))
header_txt <- header_txt %>% paste0(markdown_line, "\nStd. dev.: ", x %>% stats::sd(na.rm = TRUE) %>% format(digits = digits, decimal.mark = decimal.mark, big.mark = big.mark),
" (CV: ", x %>% cv(na.rm = TRUE) %>% format(digits = digits, decimal.mark = decimal.mark, big.mark = big.mark),
", MAD: ", x %>% stats::mad(na.rm = TRUE) %>% format(digits = digits, decimal.mark = decimal.mark, big.mark = big.mark), ")")
header_txt <- header_txt %>% paste0(markdown_line, "\nFive-Num: ", Tukey_five %>% format(digits = digits, decimal.mark = decimal.mark, big.mark = big.mark) %>% trimws() %>% paste(collapse = " | "),
" (IQR: ", (Tukey_five[4] - Tukey_five[2]) %>% format(digits = digits, decimal.mark = decimal.mark, big.mark = big.mark),
", CQV: ", x %>% cqv(na.rm = TRUE) %>% format(digits = digits, decimal.mark = decimal.mark, big.mark = big.mark), ")")
outlier_length <- length(boxplot.stats(x)$out)
header_txt <- header_txt %>% paste0(markdown_line, "\nOutliers: ", outlier_length)
if (outlier_length > 0) {
header_txt <- header_txt %>% paste0(" (unique count: ", boxplot.stats(x)$out %>% n_distinct(), ")")
}
header_list$mean <- base::mean(x, na.rm = TRUE)
header_list$sd <- stats::sd(x, na.rm = TRUE)
header_list$cv <- cv(x, na.rm = TRUE)
header_list$mad <- stats::mad(x, na.rm = TRUE)
Tukey_five <- stats::fivenum(x, na.rm = TRUE)
header_list$fivenum <- Tukey_five
header_list$IQR <- Tukey_five[4] - Tukey_five[2]
header_list$cqv <- cqv(x, na.rm = TRUE)
header_list$outliers_total <- length(boxplot.stats(x)$out)
header_list$outliers_unique <- n_distinct(boxplot.stats(x)$out)
}
if (NROW(x) > 0 & any(class(x) == "rsi")) {
header_txt <- header_txt %>% paste0("\n")
cnt_S <- sum(x == "S", na.rm = TRUE)
cnt_IR <- sum(x %in% c("I", "R"), na.rm = TRUE)
header_txt <- header_txt %>% paste(markdown_line, "\n%IR: ",
(cnt_IR / sum(!is.na(x), na.rm = TRUE)) %>% percent(force_zero = TRUE, round = digits, decimal.mark = decimal.mark),
paste0("(ratio S : IR = 1.0 : ", (cnt_IR / cnt_S) %>% format(digits = 1, nsmall = 1, decimal.mark = decimal.mark, big.mark = big.mark), ")"))
if (NROW(x) < 30) {
header_txt <- header_txt %>% paste(markdown_line, red("\nToo few isolates for reliable resistance interpretation."))
}
header_list$count_S <- sum(x == "S", na.rm = TRUE)
header_list$count_IR <- sum(x %in% c("I", "R"), na.rm = TRUE)
}
formatdates <- "%e %B %Y" # = d mmmm yyyy
@ -421,26 +380,18 @@ frequency_tbl <- function(x, @@ -421,26 +380,18 @@ frequency_tbl <- function(x,
formatdates <- "%H:%M:%S"
}
if (NROW(x) > 0 & any(class(x) %in% c("Date", "POSIXct", "POSIXlt"))) {
header_txt <- header_txt %>% paste0("\n")
mindate <- x %>% min(na.rm = TRUE)
maxdate <- x %>% max(na.rm = TRUE)
maxdate_days <- difftime(maxdate, mindate, units = "auto") %>% as.double()
mediandate <- x %>% median(na.rm = TRUE)
median_days <- difftime(mediandate, mindate, units = "auto") %>% as.double()
if (formatdates == "%H:%M:%S") {
# hms
header_txt <- header_txt %>% paste0(markdown_line, "\nEarliest: ", mindate %>% format(formatdates) %>% trimws())
header_txt <- header_txt %>% paste0(markdown_line, "\nLatest: ", maxdate %>% format(formatdates) %>% trimws(),
" (+", difftime(maxdate, mindate, units = "mins") %>% as.double() %>% format(digits = digits, decimal.mark = decimal.mark, big.mark = big.mark), " min.)")
header_list$earliest <- min(x, na.rm = TRUE)
header_list$latest <- max(x, na.rm = TRUE)
} else {
# other date formats
header_txt <- header_txt %>% paste0(markdown_line, "\nOldest: ", mindate %>% format(formatdates) %>% trimws())
header_txt <- header_txt %>% paste0(markdown_line, "\nNewest: ", maxdate %>% format(formatdates) %>% trimws(),
" (+", difftime(maxdate, mindate, units = "auto") %>% as.double() %>% format(digits = digits, decimal.mark = decimal.mark, big.mark = big.mark), ")")
header_list$oldest <- min(x, na.rm = TRUE)
header_list$newest <- max(x, na.rm = TRUE)
}
header_txt <- header_txt %>% paste0(markdown_line, "\nMedian: ", mediandate %>% format(formatdates) %>% trimws(),
" (~", percent(median_days / maxdate_days, round = 0, decimal.mark = decimal.mark), ")")
header_list$median <- median(x, na.rm = TRUE)
header_list$date_format <- formatdates
}
if (any(class(x) == "POSIXlt")) {
x <- x %>% format(formatdates)
@ -463,10 +414,13 @@ frequency_tbl <- function(x, @@ -463,10 +414,13 @@ frequency_tbl <- function(x,
column_align <- c(x_align, "r", "r", "r", "r")
if (is.null(df)) {
# create table with counts and percentages
df <- tibble(item = x) %>%
group_by(item) %>%
summarise(count = n())
suppressWarnings( # suppress since dplyr 0.8.0, which idiotly warns about included NAs :(
# create table with counts and percentages
df <- tibble(item = x) %>%
group_by(item) %>%
summarise(count = n())
)
# sort according to setting
if (sort.count == TRUE) {
@ -515,14 +469,18 @@ frequency_tbl <- function(x, @@ -515,14 +469,18 @@ frequency_tbl <- function(x,
title <- trimws(gsub("^Frequency table of", "", title[1L], ignore.case = TRUE))
}
# if (nmax.set == FALSE) {
# nmax <- nrow(df)
# }
structure(.Data = df,
class = c("frequency_tbl", class(df)),
header = header_list,
opt = list(title = title,
data = x.name,
vars = cols,
group_var = x.group,
header = header,
header_txt = header_txt,
row_names = row.names,
column_names = column_names,
column_align = column_align,
@ -530,6 +488,7 @@ frequency_tbl <- function(x, @@ -530,6 +488,7 @@ frequency_tbl <- function(x,
big.mark = big.mark,
tbl_format = tbl_format,
na = na,
digits = digits,
nmax = nmax,
nmax.set = nmax.set))
}
@ -538,6 +497,144 @@ frequency_tbl <- function(x, @@ -538,6 +497,144 @@ frequency_tbl <- function(x,
#' @export
freq <- frequency_tbl
#' @importFrom crayon silver green red
#' @importFrom dplyr %>%
format_header <- function(x, markdown = FALSE, decimal.mark = ".", big.mark = ",", digits = 2) {
newline <-"\n"
if (markdown == TRUE) {
newline <- " \n"
}
header <- header(x)
x_class <- header$class
has_length <- header$length + header$na_length > 0
# FORMATTING
# rsi
if (has_length == TRUE & any(x_class == "rsi")) {
header$`%IR` <- paste((header$count_IR / header$length) %>% percent(force_zero = TRUE, round = digits, decimal.mark = decimal.mark),
paste0("(ratio S : IR = 1.0 : ", (header$count_IR / header$count_S) %>% format(digits = 1, nsmall = 1, decimal.mark = decimal.mark, big.mark = big.mark), ")"))
header <- header[!names(header) %in% c("count_S", "count_IR")]
}
# dates
if (!is.null(header$date_format)) {
if (header$date_format == "%H:%M:%S") {
header$median <- paste0(format(header$median, header$date_format),
" (",
(as.double(difftime(header$median, header$earliest, units = "auto")) /
as.double(difftime(header$latest, header$earliest, units = "auto"))) %>%
percent(round = digits, decimal.mark = decimal.mark), ")")
header$latest <- paste0(format(header$latest, header$date_format),
" (+",
difftime(header$latest, header$earliest, units = "mins") %>%
as.double() %>%
format(digits = digits, decimal.mark = decimal.mark, big.mark = big.mark),
" min.)")
header$earliest <- format(header$earliest, header$date_format)
header$median <- trimws(header$median)
header$latest <- trimws(header$latest)
header$earliest <- trimws(header$earliest)
} else {
header$median <- paste0(format(header$median, header$date_format),
" (",
(as.double(difftime(header$median, header$oldest, units = "auto")) /
as.double(difftime(header$newest, header$oldest, units = "auto"))) %>%
percent(round = digits, decimal.mark = decimal.mark), ")")
header$newest <- paste0(format(header$newest, header$date_format),
" (+",
difftime(header$newest, header$oldest, units = "auto") %>%
as.double() %>%
format(digits = digits, decimal.mark = decimal.mark, big.mark = big.mark),
")")
header$oldest <- format(header$oldest, header$date_format)
header$median <- trimws(header$median)
header$newest <- trimws(header$newest)
header$oldest <- trimws(header$oldest)
}
header <- header[names(header) != "date_format"]
}
# class and mode
if (is.null(header$columns)) {
if (!header$mode %in% header$class) {
header$class <- header$class %>% rev() %>% paste(collapse = " > ") %>% paste0(silver(paste0(" (", header$mode, ")")))
} else {
header$class <- header$class %>% rev() %>% paste(collapse = " > ")
}
header <- header[names(header) != "mode"]
}
# levels
if (!is.null(header$levels)) {
n_levels <- header$levels %>% length()
n_levels_list <- header$levels
if (n_levels > 5) {
n_levels_list <- c(n_levels_list[1:5], "...")
}
if (header$ordered == TRUE) {
n_levels_list <- paste0(header$levels, collapse = " < ")
} else {
n_levels_list <- paste0(header$levels, collapse = ", ")
}
header$levels <- n_levels_list
header <- header[names(header) != "ordered"]
}
# length and NAs
if (has_length == TRUE) {
na_txt <- paste0(header$na_length %>% format(decimal.mark = decimal.mark, big.mark = big.mark), " = ",
(header$na_length / (header$na_length + header$length)) %>% percent(force_zero = TRUE, round = digits, decimal.mark = decimal.mark) %>%
sub("NaN", "0", ., fixed = TRUE))
if (!na_txt %like% "^0 =") {
na_txt <- red(na_txt)
} else {
na_txt <- green(na_txt)
}
na_txt <- paste0("(of which NA: ", na_txt, ")")
} else {
na_txt <- ""
}
header$length <- paste((header$na_length + header$length) %>% format(decimal.mark = decimal.mark, big.mark = big.mark),
na_txt)
header <- header[names(header) != "na_length"]
# format all numeric values
header <- lapply(header, function(x)
if (is.numeric(x))
if (any(x < 1000)) {
format(round2(x, digits = digits), decimal.mark = decimal.mark, big.mark = big.mark)
} else {
format(x, digits = digits, decimal.mark = decimal.mark, big.mark = big.mark)
}
else
x
)
# numeric values
if (has_length == TRUE & any(x_class %in% c("double", "integer", "numeric", "raw", "single"))) {
header$sd <- paste0(header$sd, " (CV: ", header$cv, ", MAD: ", header$mad, ")")
header$fivenum <- paste0(paste(header$fivenum, collapse = " | "), " (IQR: ", header$IQR, ", CQV: ", header$cqv, ")")
header$outliers_total <- paste0(header$outliers_total, " (unique count: ", header$outliers_unique, ")")
header <- header[!names(header) %in% c("cv", "mad", "IQR", "cqv", "outliers_unique")]
}
# header names
header_names <- paste0(names(header), ": ")
header_names <- gsub("sd", "SD", header_names)
header_names <- gsub("fivenum", "Five-Num", header_names)
header_names <- gsub("outliers_total", "Outliers", header_names)
# capitalise first character
header_names <- gsub("^(.)", "\\U\\1", header_names, perl = TRUE)
# make all header captions equal size
header_names <- gsub("\\s", " ", format(header_names,
width = max(nchar(header_names),
na.rm = TRUE)))
header <- paste0(header_names, header)
header <- paste(header, collapse = newline)
# add newline after 'Unique'
gsub("(.*Unique.*\\n)(.*?)", paste0("\\1", newline, "\\2"), header)
}
#' @rdname freq
#' @export
#' @importFrom dplyr top_n pull
@ -557,6 +654,19 @@ top_freq <- function(f, n) { @@ -557,6 +654,19 @@ top_freq <- function(f, n) {
vect
}
#' @rdname freq
#' @export
header <- function(f, property = NULL) {
if (is.null(property)) {
attributes(f)$header
} else {
a <- attributes(f)$header
if (any(property %in% names(f))) {
a[names(a) %in% property]
}
}
}
#' @noRd
#' @exportMethod diff.frequency_tbl
#' @importFrom dplyr %>% full_join mutate
@ -615,13 +725,16 @@ diff.frequency_tbl <- function(x, y, ...) { @@ -615,13 +725,16 @@ diff.frequency_tbl <- function(x, y, ...) {
#' @importFrom dplyr n_distinct
#' @importFrom crayon bold silver
#' @export
print.frequency_tbl <- function(x, nmax = getOption("max.print.freq", default = 15),
markdown = !interactive(), header = !markdown,
print.frequency_tbl <- function(x,
nmax = getOption("max.print.freq", default = 15),
markdown = !interactive(),
header = !markdown,
decimal.mark = getOption("OutDec"),
big.mark = ifelse(decimal.mark != ",", ",", "."),
...) {
opt <- attr(x, "opt")
opt$header_txt <- header(x)
if (length(opt$vars) == 0) {
opt$vars <- NULL
@ -658,6 +771,13 @@ print.frequency_tbl <- function(x, nmax = getOption("max.print.freq", default = @@ -658,6 +771,13 @@ print.frequency_tbl <- function(x, nmax = getOption("max.print.freq", default =
opt$nmax <- nmax
opt$nmax.set <- TRUE
}
if (opt$nmax %in% c(0, Inf, NA, NULL)) {
opt$nmax <- NROW(x)
opt$nmax.set <- FALSE
} else if (opt$nmax >= NROW(x)) {
opt$nmax.set <- FALSE
}
if (!missing(decimal.mark)) {
opt$decimal.mark <- decimal.mark
}
@ -673,7 +793,15 @@ print.frequency_tbl <- function(x, nmax = getOption("max.print.freq", default = @@ -673,7 +793,15 @@ print.frequency_tbl <- function(x, nmax = getOption("max.print.freq", default =
}
}
if (!missing(markdown)) {
opt$tbl_format <- "markdown"
if (markdown == TRUE) {
opt$tbl_format <- "markdown"
if (missing(header)) {
# default header off for markdown
header <- FALSE
}
} else {
opt$tbl_format <- "pandoc"
}
}
if (!missing(header)) {
opt$header <- header
@ -689,7 +817,10 @@ print.frequency_tbl <- function(x, nmax = getOption("max.print.freq", default = @@ -689,7 +817,10 @@ print.frequency_tbl <- function(x, nmax = getOption("max.print.freq", default =
if (opt$header == TRUE) {
cat(title, "\n")
if (!is.null(opt$header_txt)) {
cat(opt$header_txt)
if (is.null(opt$digits)) {
opt$digits <- 2
}
cat(format_header(x, digits = opt$digits, markdown = markdown, decimal.mark = decimal.mark, big.mark = big.mark))
}
} else if (opt$tbl_format == "markdown") {
# do print title as caption in markdown
@ -708,11 +839,11 @@ print.frequency_tbl <- function(x, nmax = getOption("max.print.freq", default = @@ -708,11 +839,11 @@ print.frequency_tbl <- function(x, nmax = getOption("max.print.freq", default =
}
options(knitr.kable.NA = opt$na)
if (nrow(x) > opt$nmax & opt$tbl_format != "markdown") {
x.rows <- nrow(x)
x.unprinted <- base::sum(x[(opt$nmax + 1):nrow(x), "count"], na.rm = TRUE)
x.printed <- base::sum(x$count) - x.unprinted
x.rows <- nrow(x)
x.unprinted <- base::sum(x[(opt$nmax + 1):nrow(x), "count"], na.rm = TRUE)
x.printed <- base::sum(x$count) - x.unprinted
if (nrow(x) > opt$nmax & opt$tbl_format != "markdown") {
if (opt$nmax.set == TRUE) {
nmax <- opt$nmax
@ -729,15 +860,28 @@ print.frequency_tbl <- function(x, nmax = getOption("max.print.freq", default = @@ -729,15 +860,28 @@ print.frequency_tbl <- function(x, nmax = getOption("max.print.freq", default =
}
footer <- paste(footer,
" -- omitted ",
format(x.rows - opt$nmax, big.mark = opt$big.mark),
format(x.rows - opt$nmax, big.mark = opt$big.mark, decimal.mark = opt$decimal.mark),
" entries, n = ",
format(x.unprinted, big.mark = opt$big.mark),
format(x.unprinted, big.mark = opt$big.mark, decimal.mark = opt$decimal.mark),
" (",
(x.unprinted / (x.unprinted + x.printed)) %>% percent(force_zero = TRUE, decimal.mark = opt$decimal.mark),
") ]\n", sep = "")
if (opt$tbl_format == "pandoc") {
footer <- silver(footer) # only silver in regular printing
}
} else if (opt$tbl_format == "markdown") {
if (opt$nmax.set == TRUE) {
x <- x[1:opt$nmax,]
footer <- paste("\n(omitted ",
format(x.rows - opt$nmax, big.mark = opt$big.mark, decimal.mark = opt$decimal.mark),
" entries, n = ",
format(x.unprinted, big.mark = opt$big.mark, decimal.mark = opt$decimal.mark),
" [",
(x.unprinted / (x.unprinted + x.printed)) %>% percent(force_zero = TRUE, decimal.mark = opt$decimal.mark),
"])\n", sep = "")
} else {
footer <- NULL
}
} else {
footer <- NULL
}

19
R/mic.R

@ -61,6 +61,9 @@ as.mic <- function(x, na.rm = FALSE) { @@ -61,6 +61,9 @@ as.mic <- function(x, na.rm = FALSE) {
x <- gsub('[^0-9]+$', '', x)
# remove last zeroes
x <- gsub('([.].?)0+$', '\\1', x)
x <- gsub('(.*[.])0+$', '\\10', x)
# remove ending .0 again
x <- gsub('[.]+0$', '', x)
# force to be character
x <- as.character(x)
@ -182,6 +185,15 @@ as.numeric.mic <- function(x, ...) { @@ -182,6 +185,15 @@ as.numeric.mic <- function(x, ...) {
as.numeric(gsub('(<|=|>)+', '', as.character(x)))
}
#' @exportMethod droplevels.mic
#' @export
#' @noRd
droplevels.mic <- function(x, exclude = if(anyNA(levels(x))) NULL else NA, ...) {
x <- droplevels.factor(x, exclude = exclude, ...)
class(x) <- c('mic', 'ordered', 'factor')
x
}
#' @exportMethod print.mic
#' @export
#' @importFrom dplyr %>% tibble group_by summarise pull
@ -230,11 +242,10 @@ barplot.mic <- function(height, ...) { @@ -230,11 +242,10 @@ barplot.mic <- function(height, ...) {
#' @importFrom graphics barplot axis
#' @importFrom dplyr %>% group_by summarise
create_barplot_mic <- function(x, x_name, ...) {
data <- data.frame(mic = x, cnt = 1) %>%
data <- data.frame(mic = droplevels(x), cnt = 1) %>%
group_by(mic) %>%
summarise(cnt = sum(cnt)) %>%
droplevels()
barplot(table(droplevels(x)),
summarise(cnt = sum(cnt))
barplot(table(droplevels.factor(x)),
ylab = 'Frequency',
xlab = 'MIC value',
main = paste('MIC values of', x_name),

13
R/misc.R

@ -27,10 +27,15 @@ addin_insert_like <- function() { @@ -27,10 +27,15 @@ addin_insert_like <- function() {
}
# No export, no Rd
# works exactly like round(), but rounds `round(0.55, 1)` as 0.6
round2 <- function(x, digits = 0) {
# works exactly like round(), but rounds `round(44.55, 1)` as 44.6 instead of 44.5 and adds decimal zeroes until `digits` is reached
round2 <- function(x, digits = 0, force_zero = TRUE) {
# https://stackoverflow.com/a/12688836/4575331
(trunc((abs(x) * 10 ^ digits) + 0.5) / 10 ^ digits) * sign(x)
val <- (trunc((abs(x) * 10 ^ digits) + 0.5) / 10 ^ digits) * sign(x)
if (digits > 0 & force_zero == TRUE) {
val[val != as.integer(val)] <- paste0(val[val != as.integer(val)],
strrep("0", max(0, digits - nchar(gsub(".*[.](.*)$", "\\1", val[val != as.integer(val)])))))
}
val
}
# No export, no Rd
@ -39,7 +44,7 @@ percent <- function(x, round = 1, force_zero = FALSE, decimal.mark = getOption(" @@ -39,7 +44,7 @@ percent <- function(x, round = 1, force_zero = FALSE, decimal.mark = getOption("
decimal.mark.options <- getOption("OutDec")
options(OutDec = ".")
val <- round2(x, round + 2) # round up 0.5
val <- round2(x, round + 2, force_zero = FALSE) # round up 0.5
val <- round(x = val * 100, digits = round) # remove floating point error
if (force_zero == TRUE) {

36
R/rsi.R

@ -129,6 +129,15 @@ print.rsi <- function(x, ...) { @@ -129,6 +129,15 @@ print.rsi <- function(x, ...) {
print(as.character(x), quote = FALSE)
}
#' @exportMethod droplevels.rsi
#' @export
#' @noRd
droplevels.rsi <- function(x, exclude = if(anyNA(levels(x))) NULL else NA, ...) {
x <- droplevels.factor(x, exclude = exclude, ...)
class(x) <- c('rsi', 'ordered', 'factor')
x
}
#' @exportMethod summary.rsi
#' @export
#' @noRd
@ -152,13 +161,16 @@ summary.rsi <- function(object, ...) { @@ -152,13 +161,16 @@ summary.rsi <- function(object, ...) {
plot.rsi <- function(x, ...) {
x_name <- deparse(substitute(x))
data <- data.frame(x = x,
y = 1,
stringsAsFactors = TRUE) %>%
group_by(x) %>%
summarise(n = sum(y)) %>%
filter(!is.na(x)) %>%
mutate(s = round((n / sum(n)) * 100, 1))
suppressWarnings(
data <- data.frame(x = x,
y = 1,
stringsAsFactors = TRUE) %>%
group_by(x) %>%
summarise(n = sum(y)) %>%
filter(!is.na(x)) %>%
mutate(s = round((n / sum(n)) * 100, 1))
)
data$x <- factor(data$x, levels = c('S', 'I', 'R'), ordered = TRUE)
ymax <- if_else(max(data$s) > 95, 105, 100)
@ -193,10 +205,12 @@ barplot.rsi <- function(height, ...) { @@ -193,10 +205,12 @@ barplot.rsi <- function(height, ...) {
x <- height
x_name <- deparse(substitute(height))
data <- data.frame(rsi = x, cnt = 1) %>%
group_by(rsi) %>%
summarise(cnt = sum(cnt)) %>%
droplevels()
suppressWarnings(
data <- data.frame(rsi = x, cnt = 1) %>%
group_by(rsi) %>%
summarise(cnt = sum(cnt)) %>%
droplevels()
)
barplot(table(x),
col = c('green3', 'orange2', 'red3'),

2
README.md

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
# `AMR` <img src="man/figures/logo_amr.png" align="right" height="120px" />
# `AMR` <img src="man/figures/logo.png" align="right" height="120px" />
### An [R package](https://www.r-project.org) to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with antibiotic properties by using evidence-based methods.
This R package was created for academic research by PhD students of the Faculty of Medical Sciences of the [University of Groningen](https://www.rug.nl) and the Medical Microbiology & Infection Prevention (MMBI) department of the [University Medical Center Groningen (UMCG)](https://www.umcg.nl).

110
_pkgdown.yml

@ -0,0 +1,110 @@ @@ -0,0 +1,110 @@
url: https://msberends.gitlab.io
title: 'AMR (for R)'
navbar:
title: 'AMR (for R)'
left:
- text: 'Home'
icon: 'fa-home'
href: 'index.html'
- text: 'Get Started'
icon: 'fa-directions'
href: 'articles/AMR.html'
- text: 'Manual'
icon: 'fa-book-open'
href: 'reference/'
- text: 'Authors'
icon: 'fa-users'
href: 'authors.html'
- text: 'Changelog'
icon: 'far fa-newspaper'
href: 'news/'
- text: 'Source Code'
icon: 'fab fa-gitlab'
href: 'https://gitlab.com/msberends/AMR'
right:
- text: 'Licence'
icon: 'fa-book'
href: 'LICENSE-text.html'
reference:
- 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
fix and extend antibiotic interpretations by applying EUCAST rules.
contents:
- starts_with("as.")
- '`eucast_rules`'
- '`read.4D`'
- title: Adding variables to your data
desc: >
Functions to add new data to existing data, like the determination
of first isolates,
contents:
- '`first_isolate`'
- '`mdro`'
- '`key_antibiotics`'
- '`mo_property`'
- '`ab_property`'
- '`atc_property`'
- '`abname`'
- '`age`'
- '`age_groups`'
- '`p.symbol`'
- '`join`'
- title: Analysing your data
desc: >
Functions for conducting AMR analysis
contents:
- '`count`'
- '`portion`'
- '`freq`'
- '`g.test`'
- '`ggplot_rsi`'
- '`kurtosis`'
- '`resistance_predict`'
- '`rsi`'
- '`skewness`'
- title: Included data sets
desc: >
References for microorganisms and antibiotics, and even a
genuine data set with isolates from septic patients.
contents:
- '`antibiotics`'
- '`microorganisms`'
- '`septic_patients`'
- '`microorganisms.certe`'
- '`microorganisms.old`'
- '`microorganisms.umcg`'
- '`supplementary_data`'
- title: Other
desc: ~
contents:
- '`get_locale`'
- '`like`'
- '`mo_failures`'
- '`mo_renamed`'
authors:
Matthijs S. Berends:
href: https://www.rug.nl/staff/m.s.berends/
Christian F. Luz:
href: https://www.rug.nl/staff/c.f.luz/
Corinna Glasner:
href: https://www.rug.nl/staff/c.glasner/
Alex W. Friedrich:
href: https://www.rug.nl/staff/a.w.friedrich/
Bhanu N. M. Sinha:
href: https://www.rug.nl/staff/b.sinha/
template:
assets: pkgdown/logos
params:
noindex: false
bootswatch: flatly
docsearch:
# using algolia.com
api_key: 'f737050abfd4d726c63938e18f8c496e'
index_name: 'amr'

1
docs/CNAME

@ -0,0 +1 @@ @@ -0,0 +1 @@
msberends.gitlab.io

102
public/LICENSE-text.html → docs/LICENSE-text.html

@ -6,13 +6,20 @@ @@ -6,13 +6,20 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>License • AMR</title>
<title>License • AMR (for R)</title>
<!-- favicons -->
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="apple-touch-icon.png" />
<link rel="apple-touch-icon" type="image/png" sizes="120x120" href="apple-touch-icon-120x120.png" />
<link rel="apple-touch-icon" type="image/png" sizes="76x76" href="apple-touch-icon-76x76.png" />
<link rel="apple-touch-icon" type="image/png" sizes="60x60" href="apple-touch-icon-60x60.png" />
<!-- jquery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<!-- Bootstrap -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
<!-- Font Awesome icons -->
@ -29,9 +36,20 @@ @@ -29,9 +36,20 @@
<script src="pkgdown.js"></script>
<!-- docsearch -->
<script src="docsearch.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/docsearch.js/2.6.1/docsearch.min.css" integrity="sha256-QOSRU/ra9ActyXkIBbiIB144aDBdtvXBcNc3OTNuX/Q=" crossorigin="anonymous" />
<link href="docsearch.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.min.js" integrity="sha256-4HLtjeVgH0eIB3aZ9mLYF6E8oU5chNdjU6p6rrXpl9U=" crossorigin="anonymous"></script>
<link href="extra.css" rel="stylesheet">
<script src="extra.js"></script>
<meta property="og:title" content="License" />
<meta property="og:image" content="https://msberends.gitlab.io/logo.png" />
<meta name="twitter:card" content="summary" />
<!-- mathjax -->
@ -59,8 +77,8 @@ @@ -59,8 +77,8 @@
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9007</span>
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.0.9008</span>
</span>
</div>
@ -68,37 +86,64 @@ @@ -68,37 +86,64 @@
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fa fa-home fa-lg"></span>
<span class="fa fa-home"></span>
Home
</a>
</li>
<li>
<a href="articles/AMR.html">
<span class="fa fa-directions"></span>
Get Started
</a>
</li>
<li>
<a href="articles/AMR.html">Get started</a>
<a href="reference/">
<span class="fa fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="reference/index.html">Reference</a>
<a href="authors.html">
<span class="fa fa-users"></span>
Authors
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<li>
<a href="news/">
<span class="far fa far fa-newspaper"></span>
<span class="caret"></span>
Changelog
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/freq.html">Creating Frequency Tables</a>
</li>
</ul>
</li>
<li>
<a href="news/index.html">Changelog</a>
<a href="https://gitlab.com/msberends/AMR">
<span class="fab fa fab fa-gitlab"></span>
Source Code
</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="LICENSE-text.html">
<span class="fa fa-book"></span>
Licence
</a>
</li>
</ul>
<form class="navbar-form navbar-right" role="search">
<div class="form-group">
<input type="search" class="form-control" name="search-input" id="search-input" placeholder="Search..." aria-label="Search for..." autocomplete="off">
</div>
</form>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
@ -460,7 +505,7 @@ Public License instead of this License. @@ -460,7 +505,7 @@ Public License instead of this License.
<footer>
<div class="copyright">
<p>Developed by Matthijs S. Berends, Christian F. Luz.</p>
<p>Developed by <a href='https://www.rug.nl/staff/m.s.berends/'>Matthijs S. Berends</a>, <a href='https://www.rug.nl/staff/c.f.luz/'>Christian F. Luz</a>, <a href='https://www.rug.nl/staff/c.glasner/'>Corinna Glasner</a>, <a href='https://www.rug.nl/staff/a.w.friedrich/'>Alex W. Friedrich</a>, <a href='https://www.rug.nl/staff/b.sinha/'>Bhanu N. M. Sinha</a>.</p>
</div>
<div class="pkgdown">
@ -470,6 +515,23 @@ Public License instead of this License. @@ -470,6 +515,23 @@ Public License instead of this License.
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/docsearch.js/2.6.1/docsearch.min.js" integrity="sha256-GKvGqXDznoRYHCwKXGnuchvKSwmx9SRMrZOTh2g4Sb0=" crossorigin="anonymous"></script>
<script>
docsearch({
apiKey: 'f737050abfd4d726c63938e18f8c496e',
indexName: 'amr',
inputSelector: 'input#search-input.form-control',
transformData: function(hits) {
return hits.map(function (hit) {
hit.url = updateHitURL(hit);
return hit;
});
}
});
</script>
</body>
</html>

BIN
docs/apple-touch-icon-120x120.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
docs/apple-touch-icon-152x152.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

BIN
docs/apple-touch-icon-180x180.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
docs/apple-touch-icon-60x60.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
docs/apple-touch-icon-76x76.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
docs/apple-touch-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

165
docs/articles/AMR.html

@ -0,0 +1,165 @@ @@ -0,0 +1,165 @@
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">