diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2509f224..6904adc8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -69,6 +69,7 @@ R-release: - '*.Rcheck/*' expire_in: '1 month' cache: + when: always key: "r350" paths: - installed_deps/ @@ -99,6 +100,7 @@ R-devel: - '*.Rcheck/*' expire_in: '1 month' cache: + when: always key: "r360" paths: - installed_deps/ diff --git a/DESCRIPTION b/DESCRIPTION index a361e464..460550fc 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR Version: 0.6.1.9003 -Date: 2019-05-16 +Date: 2019-05-17 Title: Antimicrobial Resistance Analysis Authors@R: c( person( diff --git a/R/freq.R b/R/freq.R index c452d457..ad9b68a6 100755 --- a/R/freq.R +++ b/R/freq.R @@ -585,10 +585,12 @@ format_header <- function(x, markdown = FALSE, decimal.mark = ".", big.mark = ", # FORMATTING # rsi if (has_length == TRUE & any(x_class == "rsi")) { - ab <- tryCatch(as.ab(attributes(x)$opt$vars), error = function(e) NA) - if (!is.na(ab) & isTRUE(length(ab) > 0)) { - header$drug <- paste0(ab_name(ab[1L]), " (", ab[1L], ", ", ab_atc(ab[1L]), ")") - header$group <- ab_group(ab[1L]) + if (!is.null(attributes(x)$opt$vars)) { + ab <- tryCatch(as.ab(attributes(x)$opt$vars), error = function(e) NA) + if (!is.na(ab) & isTRUE(length(ab) > 0)) { + header$drug <- paste0(ab_name(ab[1L]), " (", ab[1L], ", ", ab_atc(ab[1L]), ")") + header$group <- ab_group(ab[1L]) + } } header$`%SI` <- percent(header$count_SI / (header$count_SI + header$count_R), force_zero = TRUE, round = digits, decimal.mark = decimal.mark) diff --git a/docs/reference/ab_property.html b/docs/reference/ab_property.html index 4e7d4bac..ce7146e6 100644 --- a/docs/reference/ab_property.html +++ b/docs/reference/ab_property.html @@ -259,6 +259,8 @@ ab_ddd(x, administration = "oral", units = FALSE, ...) +ab_info(x, language = get_locale(), ...) + ab_property(x, property = "name", language = get_locale(), ...)
ab_name()
ab_atc()
ab_cid()
ab_synonyms()
ab_tradenames()
ab_group()
ab_atc_group1()
ab_atc_group2()
ab_ddd()
ab_property()
ab_name()
ab_atc()
ab_cid()
ab_synonyms()
ab_tradenames()
ab_group()
ab_atc_group1()
ab_atc_group2()
ab_ddd()
ab_info()
ab_property()
Property of an antibiotic