Browse Source

(v1.6.0.9013) website update

pull/67/head
parent
commit
a9fd4aa49f
  1. 4
      DESCRIPTION
  2. 11
      NEWS.md
  3. 25
      R/deprecated.R
  4. 12
      R/episode.R
  5. 139
      R/first_isolate.R
  6. 2
      R/ggplot_pca.R
  7. 2
      R/join_microorganisms.R
  8. 5
      R/key_antimicrobials.R
  9. 2
      R/random.R
  10. BIN
      R/sysdata.rda
  11. BIN
      data-raw/AMR_latest.tar.gz
  12. 38
      docs/404.html
  13. 38
      docs/LICENSE-text.html
  14. 38
      docs/articles/index.html
  15. 41
      docs/authors.html
  16. 30
      docs/extra.css
  17. 40
      docs/extra.js
  18. 62
      docs/index.html
  19. 736
      docs/news/index.html
  20. 4
      docs/pkgdown.yml
  21. 10
      docs/reference/AMR-deprecated.html
  22. 65
      docs/reference/first_isolate.html
  23. 48
      docs/reference/get_episode.html
  24. 42
      docs/reference/ggplot_pca.html
  25. 42
      docs/reference/index.html
  26. 40
      docs/reference/join.html
  27. 45
      docs/reference/key_antimicrobials.html
  28. 40
      docs/reference/random.html
  29. 38
      docs/survey.html
  30. 3
      inst/CITATION
  31. 9
      man/AMR-deprecated.Rd
  32. 59
      man/first_isolate.Rd
  33. 10
      man/get_episode.Rd
  34. 2
      man/ggplot_pca.Rd
  35. 2
      man/join.Rd
  36. 5
      man/key_antimicrobials.Rd
  37. 2
      man/random.Rd
  38. 30
      pkgdown/extra.css
  39. 40
      pkgdown/extra.js
  40. 13
      tests/testthat/test-_deprecated.R
  41. 3
      tests/testthat/test-first_isolate.R

4
DESCRIPTION

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
Package: AMR
Version: 1.6.0.9012
Date: 2021-04-27
Version: 1.6.0.9013
Date: 2021-04-29
Title: Antimicrobial Resistance Data Analysis
Authors@R: c(
person(role = c("aut", "cre"),

11
NEWS.md

@ -1,15 +1,14 @@ @@ -1,15 +1,14 @@
# AMR 1.6.0.9012
## <small>Last updated: 27 April 2021</small>
# AMR 1.6.0.9013
## <small>Last updated: 29 April 2021</small>
### New
* Function `custom_eucast_rules()` that brings support for custom AMR rules in `eucast_rules()`
* Support for all four methods to determine first isolates as summarised by Hindler *et al* (doi: [10.1086/511864](https://doi.org/10.1086/511864)): isolate-based, patient-based, episode-based and phenotype-based. The last method is now the default.
* Since fungal isolates can also be selected, new functions `key_antimicrobials()` and `all_antimicrobials()` have replaced the now deprecated function `key_antibiotics()`
* Using `key_antimicrobials()` still only selects six preferred antibiotics for Gram-negatives, six for Gram-positives, and six universal antibiotics. It has a new `antifungal` argument to set antifungal agents (antimycotics).
* The `first_isolate()` function gained the argument `method` that has to be "phenotype-based", "episode-based", "patient-based", or "isolate-based". The old behaviour is equal to "episode-based", while the new default is "phenotype-based".
* The `first_isolate()` function gained the argument `method` that has to be "phenotype-based", "episode-based", "patient-based", or "isolate-based". The old behaviour is equal to "episode-based". The new default is "phenotype-based" if antimicrobial test results are available, and "episode-based" otherwise. This new default will yield slightly more isolates for selection (which is a good thing).
* Since fungal isolates can also be selected, the functions `key_antibiotics()` and `key_antibiotics_equal()` are now deprecated in favour of the `key_antimicrobials()` and `antimicrobial_equal()` functions. Also, the new `all_antimicrobials()` function works like the old `key_antibiotics()` function, but includes any column with antimicrobial test results. Using `key_antimicrobials()` still only selects six preferred antibiotics for Gram-negatives, six for Gram-positives, and six universal antibiotics. It has a new `antifungal` argument to set antifungal agents (antimycotics).
* Using `type == "points"` in the `first_isolate()` function for phenotype-based selection will now consider all antimicrobial drugs in the data set, using the new `all_antimicrobials()`
* The `first_isolate()` function can now take a vector of values for `col_keyantibiotics` and can have an episode length of `Inf`
* The `filter_first_isolate()` function has not changed, as it uses the episode-based method. The `filter_first_weighted_isolate()` may now include more isolates as uses the phenotype-based method.
* Since the phenotype-based method is the new default, `filter_first_isolate()` renders the `filter_first_weighted_isolate()` function redundant. For this reason, `filter_first_weighted_isolate()` is now deprecated.
* The documentation of the `first_isolate()` and `key_antimicrobials()` functions has been completely rewritten.
### Changed

25
R/deprecated.R

@ -46,6 +46,31 @@ p_symbol <- function(p, emptychar = " ") { @@ -46,6 +46,31 @@ p_symbol <- function(p, emptychar = " ") {
s
}
#' @name AMR-deprecated
#' @export
filter_first_weighted_isolate <- function(x = NULL,
col_date = NULL,
col_patient_id = NULL,
col_mo = NULL,
...) {
.Deprecated(old = "filter_first_weighted_isolate()",
new = "filter_first_isolate()",
package = "AMR")
if (is_null_or_grouped_tbl(x)) {
# when `x` is left blank, auto determine it (get_current_data() also contains dplyr::cur_data_all())
# is also fix for using a grouped df as input (a dot as first argument)
x <- tryCatch(get_current_data(arg_name = "x", call = -2), error = function(e) x)
}
meet_criteria(x, allow_class = "data.frame") # also checks dimensions to be >0
meet_criteria(col_date, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
meet_criteria(col_patient_id, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
meet_criteria(col_mo, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
filter_first_isolate(x = x, col_date = col_date, col_patient_id = col_patient_id, col_mo = col_mo, ...)
}
#' @name AMR-deprecated
#' @export
key_antibiotics <- function(x = NULL,

12
R/episode.R

@ -29,13 +29,13 @@ @@ -29,13 +29,13 @@
#' @inheritSection lifecycle Stable Lifecycle
#' @param x vector of dates (class `Date` or `POSIXt`)
#' @param episode_days required episode length in days, can also be less than a day or `Inf`, see *Details*
#' @param ... currently not used
#' @param ... ignored, only in place to allow future extensions
#' @details
#' Dates are first sorted from old to new. The oldest date will mark the start of the first episode. After this date, the next date will be marked that is at least `episode_days` days later than the start of the first episode. From that second marked date on, the next date will be marked that is at least `episode_days` days later than the start of the second episode which will be the start of the third episode, and so on. Before the vector is being returned, the original order will be restored.
#'
#' The [first_isolate()] function is a wrapper around the [is_new_episode()] function, but is more efficient for data sets containing microorganism codes or names.
#' The [first_isolate()] function is a wrapper around the [is_new_episode()] function, but is more efficient for data sets containing microorganism codes or names and allows for different isolate selection methods.
#'
#' The `dplyr` package is not required for these functions to work, but these functions support [variable grouping][dplyr::group_by()] and work conveniently inside `dplyr` verbs such as [`filter()`][dplyr::filter()], [`mutate()`][dplyr::mutate()] and [`summarise()`][dplyr::summarise()].
#' The `dplyr` package is not required for these functions to work, but these functions do support [variable grouping][dplyr::group_by()] and work conveniently inside `dplyr` verbs such as [`filter()`][dplyr::filter()], [`mutate()`][dplyr::mutate()] and [`summarise()`][dplyr::summarise()].
#' @return
#' * [get_episode()]: a [double] vector
#' * [is_new_episode()]: a [logical] vector
@ -85,8 +85,8 @@ @@ -85,8 +85,8 @@
#' n_episodes_30 = sum(is_new_episode(date, episode_days = 30)))
#'
#'
#' # grouping on patients and microorganisms leads to the same results
#' # as first_isolate():
#' # grouping on patients and microorganisms leads to the same
#' # results as first_isolate() when using 'episode-based':
#' x <- example_isolates %>%
#' filter_first_isolate(include_unknown = TRUE,
#' method = "episode-based")
@ -127,7 +127,7 @@ is_new_episode <- function(x, episode_days, ...) { @@ -127,7 +127,7 @@ is_new_episode <- function(x, episode_days, ...) {
}
exec_episode <- function(type, x, episode_days, ...) {
x <- as.double(as.POSIXct(x)) # as.POSIXct() for Date classes
x <- as.double(as.POSIXct(x)) # as.POSIXct() required for Date classes
# since x is now in seconds, get seconds from episode_days as well
episode_seconds <- episode_days * 60 * 60 * 24

139
R/first_isolate.R

@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
#' Determine First (Weighted) Isolates
#'
#' Determine first (weighted) isolates of all microorganisms of every patient per episode and (if needed) per specimen type. To determine patient episodes not necessarily based on microorganisms, use [is_new_episode()] that also supports grouping with the `dplyr` package.
#' Determine first (weighted) isolates of all microorganisms of every patient per episode and (if needed) per specimen type. These functions support all four methods as summarised by Hindler *et al.* in 2007 (\doi{10.1086/511864}). To determine patient episodes not necessarily based on microorganisms, use [is_new_episode()] that also supports grouping with the `dplyr` package.
#' @inheritSection lifecycle Stable Lifecycle
#' @param x a [data.frame] containing isolates. Can be left blank for automatic determination, see *Examples*.
#' @param col_date column name of the result date (or date that is was received on the lab), defaults to the first column with a date class
@ -40,15 +40,15 @@ @@ -40,15 +40,15 @@
#' @param icu_exclude logical to indicate whether ICU isolates should be excluded (rows with value `TRUE` in the column set with `col_icu`)
#' @param specimen_group value in the column set with `col_specimen` to filter on
#' @param type type to determine weighed isolates; can be `"keyantimicrobials"` or `"points"`, see *Details*
#' @param method the algorithm to apply, either `"phenotype-based"`, `"episode-based"`, `"patient-based"` or `"isolate-based"` (can be abbreviated), see *Details*
#' @param method the method to apply, either `"phenotype-based"`, `"episode-based"`, `"patient-based"` or `"isolate-based"` (can be abbreviated), see *Details*. The default is `"phenotype-based"` if antimicrobial test results are present in the data, and `"episode-based"` otherwise.
#' @param ignore_I logical to indicate whether antibiotic interpretations with `"I"` will be ignored when `type = "keyantimicrobials"`, see *Details*
#' @param points_threshold minimum number of points to require before differences in the antibiogram will lead to inclusion of an isolate when `type = "points"`, see *Details*
#' @param info a [logical] to indicate info should be printed, defaults to `TRUE` only in interactive mode
#' @param include_unknown logical to indicate whether 'unknown' microorganisms should be included too, i.e. microbial code `"UNKNOWN"`, which defaults to `FALSE`. For WHONET users, this means that all records with organism code `"con"` (*contamination*) will be excluded at default. Isolates with a microbial ID of `NA` will always be excluded as first isolate.
#' @param include_untested_rsi logical to indicate whether also rows without antibiotic results are still eligible for becoming a first isolate. Use `include_untested_rsi = FALSE` to always return `FALSE` for such rows. This checks the data set for columns of class `<rsi>` and consequently requires transforming columns with antibiotic results using [as.rsi()] first.
#' @param ... arguments passed on to [first_isolate()] when using [filter_first_isolate()], or arguments passed on to [key_antimicrobials()] otherwise (such as `universal`, `gram_negative`, `gram_positive`)
#' @param ... arguments passed on to [first_isolate()] when using [filter_first_isolate()], otherwise arguments passed on to [key_antimicrobials()] (such as `universal`, `gram_negative`, `gram_positive`)
#' @details
#' To conduct epidemiological analyses on antimicrobial resistance data, only so-called first isolates should be included to prevent overestimation and underestimation of antimicrobial resistance. Different algorithms can be used to do so, see below.
#' To conduct epidemiological analyses on antimicrobial resistance data, only so-called first isolates should be included to prevent overestimation and underestimation of antimicrobial resistance. Different methods can be used to do so, see below.
#'
#' These functions are context-aware. This means that then the `x` argument can be left blank, see *Examples*.
#'
@ -56,51 +56,51 @@ @@ -56,51 +56,51 @@
#'
#' All isolates with a microbial ID of `NA` will be excluded as first isolate.
#'
#' ## Different algorithms
#' ## Different methods
#'
#' According to Hindler *et al.* (2007, \doi{10.1086/511864}), there are different algorithms to select first isolates with increasing reliability: isolate-based, patient-based, episode-based and phenotype-based. All algorithms select on a combination of the taxonomic genus and species (not subspecies).
#' According to Hindler *et al.* (2007, \doi{10.1086/511864}), there are different methods (algorithms) to select first isolates with increasing reliability: isolate-based, patient-based, episode-based and phenotype-based. All methods select on a combination of the taxonomic genus and species (not subspecies).
#'
#' All mentioned algorithms are covered in the [first_isolate()] function:
#' All mentioned methods are covered in the [first_isolate()] function:
#'
#'
#' | **Algorithm** | **Function to apply** |
#' | **Method** | **Function to apply** |
#' |--------------------------------------------------|-------------------------------------------------------|
#' | Isolate-based | `first_isolate(x, method = "isolate-based")` |
#' | **Isolate-based** | `first_isolate(x, method = "isolate-based")` |
#' | *(= all isolates)* | |
#' | | |
#' | | |
#' | Patient-based | `first_isolate(x, method = "patient-based")` |
#' | **Patient-based** | `first_isolate(x, method = "patient-based")` |
#' | *(= first isolate per patient)* | |
#' | | |
#' | | |
#' | Episode-based | `first_isolate(x, method = "episode-based")`, or: |
#' | **Episode-based** | `first_isolate(x, method = "episode-based")`, or: |
#' | *(= first isolate per episode)* | |
#' | - 7-Day interval from initial isolate | - `first_isolate(x, method = "e", episode_days = 7)` |
#' | - 30-Day interval from initial isolate | - `first_isolate(x, method = "e", episode_days = 30)` |
#' | | |
#' | | |
#' | Phenotype-based | `first_isolate(x, method = "phenotype-based")`, or: |
#' | **Phenotype-based** | `first_isolate(x, method = "phenotype-based")`, or: |
#' | *(= first isolate per phenotype)* | |
#' | - Major difference in any antimicrobial result | - `first_isolate(x, type = "points")` |
#' | - Any difference in key antimicrobial results | - `first_isolate(x, type = "keyantimicrobials")` |
#'
#' ### Isolate-based
#'
#' This algorithm does not require any selection, as all isolates should be included. It does, however, respect all arguments set in the [first_isolate()] function. For example, the default setting for `include_unknown` (`FALSE`) will omit selection of rows without a microbial ID.
#' This method does not require any selection, as all isolates should be included. It does, however, respect all arguments set in the [first_isolate()] function. For example, the default setting for `include_unknown` (`FALSE`) will omit selection of rows without a microbial ID.
#'
#' ### Patient-based
#'
#' To include every genus-species combination per patient once, set the `episode_days` to `Inf`. Although often inappropriate, this algorithm makes sure that no duplicate isolates are selected from the same patient.
#' To include every genus-species combination per patient once, set the `episode_days` to `Inf`. Although often inappropriate, this method makes sure that no duplicate isolates are selected from the same patient. In a large longitudinal data set, this could mean that isolates are *excluded* that were found years after the initial isolate.
#'
#' ### Episode-based
#'
#' To include every genus-species combination per patient episode once, set the `episode_days` to a sensible number of days. Depending on the type of analysis, this could be 14, 30, 60 or 365. Short episodes are common for analysing specific hospital or ward data, long episodes are common for analysing regional and national data.
#'
#' This is the most common algorithm to correct for duplicate isolates. Patients are categorised into episodes based on their ID and dates (e.g., the date of specimen receipt or laboratory result). While this is a common algorithm, it does not take into account antimicrobial test results. This means that e.g. a methicillin-resistant *Staphylococcus aureus* (MRSA) isolate cannot be differentiated from a wildtype *Staphylococcus aureus* isolate.
#' This is the most common method to correct for duplicate isolates. Patients are categorised into episodes based on their ID and dates (e.g., the date of specimen receipt or laboratory result). While this is a common method, it does not take into account antimicrobial test results. This means that e.g. a methicillin-resistant *Staphylococcus aureus* (MRSA) isolate cannot be differentiated from a wildtype *Staphylococcus aureus* isolate.
#'
#' ### Phenotype-based
#'
#' This is a more reliable algorithm, since it also *weighs* the antibiogram (antimicrobial test results) yielding so-called 'first weighted isolates'. There are two different methods to weigh the antibiogram:
#' This is a more reliable method, since it also *weighs* the antibiogram (antimicrobial test results) yielding so-called 'first weighted isolates'. There are two different methods to weigh the antibiogram:
#'
#' 1. Using `type = "points"` and argument `points_threshold`
#'
@ -116,14 +116,16 @@ @@ -116,14 +116,16 @@
#' Key antimicrobials are internally selected using the [key_antimicrobials()] function, but can also be added manually as a variable to the data and set in the `col_keyantimicrobials` argument. Another option is to pass the output of the [key_antimicrobials()] function directly to the `col_keyantimicrobials` argument.
#'
#'
#' The default algorithm is phenotype-based (using `type = "points"`) and episode-based (using `episode_days = 365`). This makes sure that every genus-species combination is selected per patient once per year, while taking into account all antimicrobial test results.
#' The default method is phenotype-based (using `type = "points"`) and episode-based (using `episode_days = 365`). This makes sure that every genus-species combination is selected per patient once per year, while taking into account all antimicrobial test results. If no antimicrobial test results are available in the data set, only the episode-based method is applied at default.
#' @rdname first_isolate
#' @seealso [key_antimicrobials()]
#' @export
#' @return A [`logical`] vector
#' @source Methodology of this function is strictly based on:
#'
#' **M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition**, 2014, *Clinical and Laboratory Standards Institute (CLSI)*. <https://clsi.org/standards/products/microbiology/documents/m39/>.
#' - **M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition**, 2014, *Clinical and Laboratory Standards Institute (CLSI)*. <https://clsi.org/standards/products/microbiology/documents/m39/>.
#'
#' - Hindler JF and Stelling J (2007). **Analysis and Presentation of Cumulative Antibiograms: A New Consensus Guideline from the Clinical and Laboratory Standards Institute.** Clinical Infectious Diseases, 44(6), 867–873. \doi{10.1086/511864}
#' @inheritSection AMR Read more on Our Website!
#' @examples
#' # `example_isolates` is a data set available in the AMR package.
@ -142,11 +144,9 @@ @@ -142,11 +144,9 @@
#' example_isolates %>%
#' filter(first_isolate())
#'
#' # short-hand versions:
#' # short-hand version:
#' example_isolates %>%
#' filter_first_isolate()
#' example_isolates %>%
#' filter_first_weighted_isolate()
#'
#' # grouped determination of first isolates (also prints group names):
#' example_isolates %>%
@ -160,7 +160,7 @@ @@ -160,7 +160,7 @@
#' resistance = resistance(GEN)) # gentamicin resistance
#'
#' B <- example_isolates %>%
#' filter_first_weighted_isolate() %>% # the 1st isolate filter
#' filter_first_isolate() %>% # the 1st isolate filter
#' group_by(hospital_id) %>%
#' summarise(count = n_rsi(GEN), # gentamicin availability
#' resistance = resistance(GEN)) # gentamicin resistance
@ -220,9 +220,7 @@ first_isolate <- function(x = NULL, @@ -220,9 +220,7 @@ first_isolate <- function(x = NULL,
meet_criteria(col_specimen, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
meet_criteria(col_icu, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
# method
if (missing(method)) {
method <- method[1L]
}
method <- coerce_method(method)
meet_criteria(method, allow_class = "character", has_length = 1, is_in = c("phenotype-based", "episode-based", "patient-based", "isolate-based", "p", "e", "i"))
# key antimicrobials
if (length(col_keyantimicrobials) > 1) {
@ -233,7 +231,7 @@ first_isolate <- function(x = NULL, @@ -233,7 +231,7 @@ first_isolate <- function(x = NULL,
if (isFALSE(col_keyantimicrobials)) {
col_keyantimicrobials <- NULL
# method cannot be phenotype-based anymore
if (method %in% c("phenotype-based", "p")) {
if (method == "phenotype-based") {
method <- "episode-based"
}
}
@ -250,10 +248,17 @@ first_isolate <- function(x = NULL, @@ -250,10 +248,17 @@ first_isolate <- function(x = NULL,
meet_criteria(include_unknown, allow_class = "logical", has_length = 1)
meet_criteria(include_untested_rsi, allow_class = "logical", has_length = 1)
method[method == "p"] <- "phenotype-based"
method[method == "e"] <- "episode-based"
method[method == "i"] <- "isolate-based"
if (info == TRUE) {
# remove data.table, grouping from tibbles, etc.
x <- as.data.frame(x, stringsAsFactors = FALSE)
any_col_contains_rsi <- any(vapply(FUN.VALUE = logical(1),
X = x,
FUN = function(x) any(as.character(x) %in% c("R", "S", "I"), na.rm = TRUE),
USE.NAMES = FALSE))
if (method == "phenotype-based" & !any_col_contains_rsi) {
method <- "episode-based"
}
if (info == TRUE & message_not_thrown_before("first_isolate.method")) {
message_(paste0("Determining first isolates using the '", font_bold(method), "' method",
ifelse(method %in% c("episode-based", "phenotype-based"),
ifelse(is.infinite(episode_days),
@ -262,11 +267,9 @@ first_isolate <- function(x = NULL, @@ -262,11 +267,9 @@ first_isolate <- function(x = NULL,
"")),
as_note = FALSE,
add_fn = font_black)
remember_thrown_message("first_isolate.method")
}
# remove data.table, grouping from tibbles, etc.
x <- as.data.frame(x, stringsAsFactors = FALSE)
# try to find columns based on type
# -- mo
if (is.null(col_mo)) {
@ -360,10 +363,11 @@ first_isolate <- function(x = NULL, @@ -360,10 +363,11 @@ first_isolate <- function(x = NULL,
testcodes_exclude <- NULL
}
# remove testcodes
if (!is.null(testcodes_exclude) & info == TRUE) {
if (!is.null(testcodes_exclude) & info == TRUE & message_not_thrown_before("first_isolate.excludingtestcodes")) {
message_("Excluding test codes: ", toString(paste0("'", testcodes_exclude, "'")),
add_fn = font_black,
as_note = FALSE)
remember_thrown_message("first_isolate.excludingtestcodes")
}
if (is.null(col_specimen)) {
@ -373,10 +377,11 @@ first_isolate <- function(x = NULL, @@ -373,10 +377,11 @@ first_isolate <- function(x = NULL,
# filter on specimen group and keyantibiotics when they are filled in
if (!is.null(specimen_group)) {
check_columns_existance(col_specimen, x)
if (info == TRUE) {
if (info == TRUE & message_not_thrown_before("first_isolate.excludingspecimen")) {
message_("Excluding other than specimen group '", specimen_group, "'",
add_fn = font_black,
as_note = FALSE)
remember_thrown_message("first_isolate.excludingspecimen")
}
}
if (!is.null(col_keyantimicrobials)) {
@ -449,18 +454,16 @@ first_isolate <- function(x = NULL, @@ -449,18 +454,16 @@ first_isolate <- function(x = NULL,
FALSE,
TRUE)
x$episode_group <- paste(x$newvar_patient_id, x$newvar_genus_species)
x$more_than_episode_ago <- unlist(lapply(unique(x$episode_group),
function(g,
df = x,
days = episode_days) {
is_new_episode(x = df[which(df$episode_group == g), ]$newvar_date,
episode_days = days)
}))
x$more_than_episode_ago <- unlist(lapply(split(x$newvar_date,
x$episode_group),
is_new_episode,
episode_days = episode_days),
use.names = FALSE)
weighted.notice <- ""
if (!is.null(col_keyantimicrobials)) {
weighted.notice <- "weighted "
if (info == TRUE) {
if (info == TRUE & message_not_thrown_before("first_isolate.type")) {
if (type == "keyantimicrobials") {
message_("Basing inclusion on key antimicrobials, ",
ifelse(ignore_I == FALSE, "not ", ""),
@ -474,6 +477,7 @@ first_isolate <- function(x = NULL, @@ -474,6 +477,7 @@ first_isolate <- function(x = NULL,
add_fn = font_black,
as_note = FALSE)
}
remember_thrown_message("first_isolate.type")
}
type_param <- type
@ -481,8 +485,7 @@ first_isolate <- function(x = NULL, @@ -481,8 +485,7 @@ first_isolate <- function(x = NULL,
z = pm_lag(x$newvar_key_ab),
type = type_param,
ignore_I = ignore_I,
points_threshold = points_threshold,
na.rm = TRUE)
points_threshold = points_threshold)
# with key antibiotics
x$newvar_first_isolate <- pm_if_else(x$newvar_row_index_sorted >= row.start &
x$newvar_row_index_sorted <= row.end &
@ -540,7 +543,8 @@ first_isolate <- function(x = NULL, @@ -540,7 +543,8 @@ first_isolate <- function(x = NULL,
}
})
message_("\nGroup: ", paste0(names(group), " = ", group, collapse = ", "), "\n",
as_note = FALSE)
as_note = FALSE,
add_fn = font_red)
}
}
}
@ -608,7 +612,8 @@ filter_first_isolate <- function(x = NULL, @@ -608,7 +612,8 @@ filter_first_isolate <- function(x = NULL,
col_date = NULL,
col_patient_id = NULL,
col_mo = NULL,
method = "episode-based",
episode_days = 365,
method = c("phenotype-based", "episode-based", "patient-based", "isolate-based"),
...) {
if (is_null_or_grouped_tbl(x)) {
# when `x` is left blank, auto determine it (get_current_data() also contains dplyr::cur_data_all())
@ -619,39 +624,27 @@ filter_first_isolate <- function(x = NULL, @@ -619,39 +624,27 @@ filter_first_isolate <- function(x = NULL,
meet_criteria(col_date, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
meet_criteria(col_patient_id, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
meet_criteria(col_mo, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
meet_criteria(method, allow_class = "character", has_length = 1, is_in = c("phenotype-based", "episode-based", "patient-based", "isolate-based"))
meet_criteria(episode_days, allow_class = c("numeric", "integer"), has_length = 1, is_positive = TRUE, is_finite = FALSE)
method <- coerce_method(method)
meet_criteria(method, allow_class = "character", has_length = 1, is_in = c("phenotype-based", "episode-based", "patient-based", "isolate-based", "p", "e", "i"))
subset(x, first_isolate(x = x,
col_date = col_date,
col_patient_id = col_patient_id,
col_mo = col_mo,
episode_days = episode_days,
method = method,
...))
}
#' @rdname first_isolate
#' @export
filter_first_weighted_isolate <- function(x = NULL,
col_date = NULL,
col_patient_id = NULL,
col_mo = NULL,
method = "phenotype-based",
...) {
if (is_null_or_grouped_tbl(x)) {
# when `x` is left blank, auto determine it (get_current_data() also contains dplyr::cur_data_all())
# is also fix for using a grouped df as input (a dot as first argument)
x <- tryCatch(get_current_data(arg_name = "x", call = -2), error = function(e) x)
}
meet_criteria(x, allow_class = "data.frame") # also checks dimensions to be >0
meet_criteria(col_date, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
meet_criteria(col_patient_id, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
meet_criteria(col_mo, allow_class = "character", has_length = 1, allow_NULL = TRUE, is_in = colnames(x))
meet_criteria(method, allow_class = "character", has_length = 1, is_in = c("phenotype-based", "episode-based", "patient-based", "isolate-based"))
subset(x, first_isolate(x = x,
col_date = col_date,
col_patient_id = col_patient_id,
col_mo = col_mo,
method = method,
...))
coerce_method <- function(method) {
if (is.null(method)) {
return(method)
}
method <- tolower(as.character(method[1L]))
method[method %like% "^(p$|pheno)"] <- "phenotype-based"
method[method %like% "^(e$|episode)"] <- "episode-based"
method[method %like% "^patient"] <- "patient-based"
method[method %like% "^(i$|iso)"] <- "isolate-based"
method
}

2
R/ggplot_pca.R

@ -47,7 +47,7 @@ @@ -47,7 +47,7 @@
#' @param arrows_textangled a logical whether the text at the end of the arrows should be angled
#' @param arrows_alpha the alpha (transparency) of the arrows and their text
#' @param base_textsize the text size for all plot elements except the labels and arrows
#' @param ... Arguments passed on to functions
#' @param ... arguments passed on to functions
#' @source The [ggplot_pca()] function is based on the `ggbiplot()` function from the `ggbiplot` package by Vince Vu, as found on GitHub: <https://github.com/vqv/ggbiplot> (retrieved: 2 March 2020, their latest commit: [`7325e88`](https://github.com/vqv/ggbiplot/commit/7325e880485bea4c07465a0304c470608fffb5d9); 12 February 2015).
#'
#' As per their GPL-2 licence that demands documentation of code changes, the changes made based on the source code were:

2
R/join_microorganisms.R

@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
#' @param x existing table to join, or character vector
#' @param by a variable to join by - if left empty will search for a column with class [`mo`] (created with [as.mo()]) or will be `"mo"` if that column name exists in `x`, could otherwise be a column name of `x` with values that exist in `microorganisms$mo` (such as `by = "bacteria_id"`), or another column in [microorganisms] (but then it should be named, like `by = c("bacteria_id" = "fullname")`)
#' @param suffix if there are non-joined duplicate variables in `x` and `y`, these suffixes will be added to the output to disambiguate them. Should be a character vector of length 2.
#' @param ... ignored
#' @param ... ignored, only in place to allow future extensions
#' @details **Note:** As opposed to the `join()` functions of `dplyr`, [character] vectors are supported and at default existing columns will get a suffix `"2"` and the newly joined columns will not get a suffix.
#'
#' If the `dplyr` package is installed, their join functions will be used. Otherwise, the much slower [merge()] function from base R will be used.

5
R/key_antimicrobials.R

@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
#' @param gram_positive names of antibiotic agents for **Gram-negatives**, case-insensitive. Set to `NULL` to ignore. See *Details* for the default agents.
#' @param antifungal names of antifungal agents for **fungi**, case-insensitive. Set to `NULL` to ignore. See *Details* for the default agents.
#' @param only_rsi_columns a logical to indicate whether only columns must be included that were transformed to class `<rsi>` (see [as.rsi()]) on beforehand (defaults to `FALSE`)
#' @param ... ignored, allows for future extensions
#' @param ... ignored, only in place to allow future extensions
#' @details
#' The [key_antimicrobials()] and [all_antimicrobials()] functions are context-aware. This means that then the `x` argument can be left blank, see *Examples*.
#'
@ -264,14 +264,12 @@ generate_antimcrobials_string <- function(df) { @@ -264,14 +264,12 @@ generate_antimcrobials_string <- function(df) {
}
#' @rdname key_antimicrobials
#' @param info unused - previously used to indicate whether a progress bar should print
#' @export
antimicrobials_equal <- function(y,
z,
type = c("points", "keyantimicrobials"),
ignore_I = TRUE,
points_threshold = 2,
info = FALSE,
...) {
meet_criteria(y, allow_class = "character")
meet_criteria(z, allow_class = "character")
@ -279,7 +277,6 @@ antimicrobials_equal <- function(y, @@ -279,7 +277,6 @@ antimicrobials_equal <- function(y,
meet_criteria(type, allow_class = "character", has_length = 1, is_in = c("points", "keyantimicrobials"))
meet_criteria(ignore_I, allow_class = "logical", has_length = 1)
meet_criteria(points_threshold, allow_class = c("numeric", "integer"), has_length = 1, is_positive = TRUE, is_finite = TRUE)
meet_criteria(info, allow_class = "logical", has_length = 1)
stop_ifnot(length(y) == length(z), "length of `y` and `z` must be equal")
key2rsi <- function(val) {

2
R/random.R

@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
#' @param mo any character that can be coerced to a valid microorganism code with [as.mo()]
#' @param ab any character that can be coerced to a valid antimicrobial agent code with [as.ab()]
#' @param prob_RSI a vector of length 3: the probabilities for R (1st value), S (2nd value) and I (3rd value)
#' @param ... extension for future versions, not used at the moment
#' @param ... ignored, only in place to allow future extensions
#' @details The base R function [sample()] is used for generating values.
#'
#' Generated values are based on the latest EUCAST guideline implemented in the [rsi_translation] data set. To create specific generated values per bug or drug, set the `mo` and/or `ab` argument.

BIN
R/sysdata.rda

Binary file not shown.

BIN
data-raw/AMR_latest.tar.gz

Binary file not shown.

38
docs/404.html

@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="https://msberends.github.io/AMR//index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9012</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9013</span>
</span>
</div>
@ -89,14 +89,14 @@ @@ -89,14 +89,14 @@
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fa fa-home"></span>
<span class="fas fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span>
<span class="fas fa-question-circle"></span>
How to
@ -105,77 +105,77 @@ @@ -105,77 +105,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/AMR.html">
<span class="fa fa-directions"></span>
<span class="fas fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="articles/resistance_predict.html">
<span class="fa fa-dice"></span>
<span class="fas fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="articles/datasets.html">
<span class="fa fa-database"></span>
<span class="fas fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="articles/PCA.html">
<span class="fa fa-compress"></span>
<span class="fas fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="articles/MDR.html">
<span class="fa fa-skull-crossbones"></span>
<span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="articles/WHONET.html">
<span class="fa fa-globe-americas"></span>
<span class="fas fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="articles/SPSS.html">
<span class="fa fa-file-upload"></span>
<span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span>
<span class="fas fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="reference/mo_property.html">
<span class="fa fa-bug"></span>
<span class="fas fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="reference/ab_property.html">
<span class="fa fa-capsules"></span>
<span class="fas fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span>
<span class="fas fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -184,21 +184,21 @@ @@ -184,21 +184,21 @@
</li>
<li>
<a href="reference/index.html">
<span class="fa fa-book-open"></span>
<span class="fas fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="authors.html">
<span class="fa fa-users"></span>
<span class="fas fa-users"></span>
Authors
</a>
</li>
<li>
<a href="news/index.html">
<span class="far fa far fa-newspaper"></span>
<span class="far fa-newspaper"></span>
Changelog
</a>
@ -207,14 +207,14 @@ @@ -207,14 +207,14 @@
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span>
<span class="fab fa-github"></span>
Source Code
</a>
</li>
<li>
<a href="survey.html">
<span class="fa fa-clipboard-list"></span>
<span class="fas fa-clipboard-list"></span>
Survey
</a>

38
docs/LICENSE-text.html

@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9012</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9013</span>
</span>
</div>
@ -89,14 +89,14 @@ @@ -89,14 +89,14 @@
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fa fa-home"></span>
<span class="fas fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span>
<span class="fas fa-question-circle"></span>
How to
@ -105,77 +105,77 @@ @@ -105,77 +105,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/AMR.html">
<span class="fa fa-directions"></span>
<span class="fas fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="articles/resistance_predict.html">
<span class="fa fa-dice"></span>
<span class="fas fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="articles/datasets.html">
<span class="fa fa-database"></span>
<span class="fas fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="articles/PCA.html">
<span class="fa fa-compress"></span>
<span class="fas fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="articles/MDR.html">
<span class="fa fa-skull-crossbones"></span>
<span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="articles/WHONET.html">
<span class="fa fa-globe-americas"></span>
<span class="fas fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="articles/SPSS.html">
<span class="fa fa-file-upload"></span>
<span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span>
<span class="fas fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="reference/mo_property.html">
<span class="fa fa-bug"></span>
<span class="fas fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="reference/ab_property.html">
<span class="fa fa-capsules"></span>
<span class="fas fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span>
<span class="fas fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -184,21 +184,21 @@ @@ -184,21 +184,21 @@
</li>
<li>
<a href="reference/index.html">
<span class="fa fa-book-open"></span>
<span class="fas fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="authors.html">
<span class="fa fa-users"></span>
<span class="fas fa-users"></span>
Authors
</a>
</li>
<li>
<a href="news/index.html">
<span class="far fa far fa-newspaper"></span>
<span class="far fa-newspaper"></span>
Changelog
</a>
@ -207,14 +207,14 @@ @@ -207,14 +207,14 @@
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span>
<span class="fab fa-github"></span>
Source Code
</a>
</li>
<li>
<a href="survey.html">
<span class="fa fa-clipboard-list"></span>
<span class="fas fa-clipboard-list"></span>
Survey
</a>

38
docs/articles/index.html

@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9012</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9013</span>
</span>
</div>
@ -89,14 +89,14 @@ @@ -89,14 +89,14 @@
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home"></span>
<span class="fas fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span>
<span class="fas fa-question-circle"></span>
How to
@ -105,77 +105,77 @@ @@ -105,77 +105,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/AMR.html">
<span class="fa fa-directions"></span>
<span class="fas fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="../articles/resistance_predict.html">
<span class="fa fa-dice"></span>
<span class="fas fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="../articles/datasets.html">
<span class="fa fa-database"></span>
<span class="fas fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="../articles/PCA.html">
<span class="fa fa-compress"></span>
<span class="fas fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="../articles/MDR.html">
<span class="fa fa-skull-crossbones"></span>
<span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="../articles/WHONET.html">
<span class="fa fa-globe-americas"></span>
<span class="fas fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="../articles/SPSS.html">
<span class="fa fa-file-upload"></span>
<span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="../articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span>
<span class="fas fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="../reference/mo_property.html">
<span class="fa fa-bug"></span>
<span class="fas fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="../reference/ab_property.html">
<span class="fa fa-capsules"></span>
<span class="fas fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="../articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span>
<span class="fas fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -184,21 +184,21 @@ @@ -184,21 +184,21 @@
</li>
<li>
<a href="../reference/index.html">
<span class="fa fa-book-open"></span>
<span class="fas fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="../authors.html">
<span class="fa fa-users"></span>
<span class="fas fa-users"></span>
Authors
</a>
</li>
<li>
<a href="../news/index.html">
<span class="far fa far fa-newspaper"></span>
<span class="far fa-newspaper"></span>
Changelog
</a>
@ -207,14 +207,14 @@ @@ -207,14 +207,14 @@
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span>
<span class="fab fa-github"></span>
Source Code
</a>
</li>
<li>
<a href="../survey.html">
<span class="fa fa-clipboard-list"></span>
<span class="fas fa-clipboard-list"></span>
Survey
</a>

41
docs/authors.html

@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9012</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.6.0.9013</span>
</span>
</div>
@ -89,14 +89,14 @@ @@ -89,14 +89,14 @@
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fa fa-home"></span>
<span class="fas fa-home"></span>
Home
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="fa fa-question-circle"></span>
<span class="fas fa-question-circle"></span>
How to
@ -105,77 +105,77 @@ @@ -105,77 +105,77 @@
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/AMR.html">
<span class="fa fa-directions"></span>
<span class="fas fa-directions"></span>
Conduct AMR analysis
</a>
</li>
<li>
<a href="articles/resistance_predict.html">
<span class="fa fa-dice"></span>
<span class="fas fa-dice"></span>
Predict antimicrobial resistance
</a>
</li>
<li>
<a href="articles/datasets.html">
<span class="fa fa-database"></span>
<span class="fas fa-database"></span>
Data sets for download / own use
</a>
</li>
<li>
<a href="articles/PCA.html">
<span class="fa fa-compress"></span>
<span class="fas fa-compress"></span>
Conduct principal component analysis for AMR
</a>
</li>
<li>
<a href="articles/MDR.html">
<span class="fa fa-skull-crossbones"></span>
<span class="fas fa-skull-crossbones"></span>
Determine multi-drug resistance (MDR)
</a>
</li>
<li>
<a href="articles/WHONET.html">
<span class="fa fa-globe-americas"></span>
<span class="fas fa-globe-americas"></span>
Work with WHONET data
</a>
</li>
<li>
<a href="articles/SPSS.html">
<span class="fa fa-file-upload"></span>
<span class="fas fa-file-upload"></span>
Import data from SPSS/SAS/Stata
</a>
</li>
<li>
<a href="articles/EUCAST.html">
<span class="fa fa-exchange-alt"></span>
<span class="fas fa-exchange-alt"></span>
Apply EUCAST rules
</a>
</li>
<li>
<a href="reference/mo_property.html">
<span class="fa fa-bug"></span>
<span class="fas fa-bug"></span>
Get properties of a microorganism
</a>
</li>
<li>
<a href="reference/ab_property.html">
<span class="fa fa-capsules"></span>
<span class="fas fa-capsules"></span>
Get properties of an antibiotic
</a>
</li>
<li>
<a href="articles/benchmarks.html">
<span class="fa fa-shipping-fast"></span>
<span class="fas fa-shipping-fast"></span>
Other: benchmarks
</a>
@ -184,21 +184,21 @@ @@ -184,21 +184,21 @@
</li>
<li>
<a href="reference/index.html">
<span class="fa fa-book-open"></span>
<span class="fas fa-book-open"></span>
Manual
</a>
</li>
<li>
<a href="authors.html">
<span class="fa fa-users"></span>
<span class="fas fa-users"></span>
Authors
</a>
</li>
<li>
<a href="news/index.html">
<span class="far fa far fa-newspaper"></span>
<span class="far fa-newspaper"></span>
Changelog
</a>
@ -207,14 +207,14 @@ @@ -207,14 +207,14 @@
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/msberends/AMR">
<span class="fab fa fab fa-github"></span>
<span class="fab fa-github"></span>
Source Code
</a>
</li>
<li>
<a href="survey.html">
<span class="fa fa-clipboard-list"></span>
<span class="fas fa-clipboard-list"></span>
Survey
</a>
@ -240,10 +240,11 @@ @@ -240,10 +240,11 @@
<pre>@Article{,
title = {AMR - An R Package for Working with Antimicrobial Resistance Data},
author = {M S Berends and C F Luz and A W Friedrich and B N M Sinha and C J Albers and C Glasner},
doi = {1.24720276528394e-05},
journal = {bioRxiv},
publisher = {Cold Spring Harbor Laboratory},
year = {2021},
url = {https://doi.org/10.1101/810622},
url = {https://www.biorxiv.org/content/10.1101/810622v4},
}</pre>
<div class="page-header">

30
docs/extra.css

@ -25,14 +25,18 @@ @@ -25,14 +25,18 @@
# ==================================================================== #
*/
/* R for Data Science (r4ds) */
#r4ds a {
display: inline-flex;
align-items: center;
text-align: right;
/* R for Data Science (r4ds) on vignettes (articles) */
#r4ds {
display: flex;
border-bottom: 1px solid #ddd;
margin-bottom: 10px;
padding-bottom: 10px;
}
#r4ds .txt {
width: 67%;
}
#r4ds img {
margin-left: 10px;
#r4ds .img {
width: 33%;
}
/* class for footer */
@ -196,16 +200,20 @@ div[id^=last-updated] h2 { @@ -196,16 +200,20 @@ div[id^=last-updated] h2 {
.table td {
padding: 4px !important;
}
.table thead {
.table thead,
.template-reference-topic .table tr:first-child {
/* tables in manual are in LaTeX and thus have no thead */
border-top: 2px solid black;
border-bottom: 2px solid black;
}
.table thead ~ tbody {
.table thead ~ tbody,
.template-reference-topic .table tr:last-child {
/* only when it has a header */
/* tables in manual are in LaTeX and thus have no thead */
border-bottom: 2px solid black;
}
.table thead th {
text-align: inherit;
/* text-align: inherit; */
}
/* all tables, including argument lists */
table a:not(.btn) {
@ -227,6 +235,8 @@ table a:not(.btn):hover { @@ -227,6 +235,8 @@ table a:not(.btn):hover {
}
.template-reference-topic h4 {
font-size: 15px;
font-weight: bold;
padding-top: 35px;
}
.template-home h4 {

40
docs/extra.js

@ -30,12 +30,6 @@ $('head').append('<!-- Updated Font Awesome library --><link rel="stylesheet" hr @@ -30,12 +30,6 @@ $('head').append('<!-- Updated Font Awesome library --><link rel="stylesheet" hr