⚠️ SERVICE NOTICE: This instance will be decommissioned 1 december of this year (2026). Please migrate your projects to our new repository: https://gitrepo.service.rug.nl

(v0.6.1.9050) support staged install

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2019-06-01 20:40:49 +02:00
1 parent a665612cb8
commit 2667fff8a7
69 files changed
+256 -259

No files matched your search

+1 -1
View File
@@ -20,4 +20,4 @@
^Meta$
^pkgdown$
^public$
^reproduction.*R$
^data-raw$
+2 -3
View File
@@ -1,6 +1,6 @@
Package: AMR
Version: 0.6.1.9049
Date: 2019-05-31
Version: 0.6.1.9050
Date: 2019-06-01
Title: Antimicrobial Resistance Analysis
Authors@R: c(
person(
@@ -70,5 +70,4 @@ BugReports: https://gitlab.com/msberends/AMR/issues
License: GPL-2 | file LICENSE
Encoding: UTF-8
LazyData: true
StagedInstall: false
RoxygenNote: 6.1.1
-1
View File
@@ -92,7 +92,6 @@ export(count_all)
export(count_df)
export(eucast_exceptional_phenotypes)
export(eucast_rules)
export(eucast_rules_file)
export(facet_rsi)
export(filter_1st_cephalosporins)
export(filter_2nd_cephalosporins)
+5 -8
View File
@@ -17,11 +17,8 @@
* All references to antibiotics in our package now use EARS-Net codes, like `AMX` for amoxicillin
* Functions `atc_certe`, `ab_umcg` and `atc_trivial_nl` have been removed
* All `atc_*` functions are superceded by `ab_*` functions
* All output will be translated by using an included, local translation file that can be found after install with:
```r
system.file("translations.tsv", package = "AMR")
```
Please create an issue in one of our repositories if you want additions in this file.
* All output will be translated by using an included translation file which [can be viewed here](https://gitlab.com/msberends/AMR/blob/master/data-raw/translations.tsv)
Please [create an issue in one of our repositories](https://gitlab.com/msberends/AMR/issues/new?issue[title]=Translation%20suggestion) if you want additions in this file.
* Improvements to plotting AMR results with `ggplot_rsi()`:
* New parameter `colours` to set the bar colours
* New parameters `title`, `subtitle`, `caption`, `x.title` and `y.title` to set titles and axis descriptions
@@ -44,7 +41,8 @@
freq(age) %>%
boxplot()
```
* Removed all hardcoded EUCAST rules and replaced them with a new reference file: `./inst/eucast/eucast.tsv`
* Removed all hardcoded EUCAST rules and replaced them with a new reference file which [can be viewed here](https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv)
Please [create an issue in one of our repositories](https://gitlab.com/msberends/AMR/issues/new?issue[title]=EUCAST%20edit) if you want changes in this file.
* Added ceftazidim intrinsic resistance to *Streptococci*
* Changed default settings for `age_groups()`, to let groups of fives and tens end with 100+ instead of 120+
* Fix for `freq()` for when all values are `NA`
@@ -56,8 +54,7 @@
* Fix for `mo_shortname()` where species would not be determined correctly
#### Other
* Support for R 3.6.0
* Prevented [staged install](https://developer.r-project.org/Blog/public/2019/02/14/staged-install/index.html) in R 3.6.0 and later by adding `StagedInstall: false` to the DESCRIPTION file
* Support for R 3.6.0 and later by providing support for [staged install](https://developer.r-project.org/Blog/public/2019/02/14/staged-install/index.html)
# AMR 0.6.1
+2 -21
View File
@@ -20,7 +20,6 @@
# ==================================================================== #
# global variables
EUCAST_RULES_FILE_LOCATION <- system.file("eucast/eucast_rules.tsv", package = "AMR")
EUCAST_VERSION_BREAKPOINTS <- "9.0, 2019"
EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016"
@@ -37,10 +36,7 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016"
#' \strong{Note:} This function does not translate MIC values to RSI values. Use \code{\link{as.rsi}} for that. \cr
#' \strong{Note:} When ampicillin (AMP, J01CA01) is not available but amoxicillin (AMX, J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance.
#'
#' The file used for applying all EUCAST rules can be retrieved with \code{\link{eucast_rules_file}()}. It returns an easily readable data set containing all rules. The original TSV file (tab separated file) that is being read by \code{eucast_rules()} can be found by running this command: \cr
#' \code{AMR::EUCAST_RULES_FILE_LOCATION} (without brackets).
#'
#' In the source code the file containing all rules is located \href{https://gitlab.com/msberends/AMR/blob/master/inst/eucast/eucast_rules.tsv}{here}.
#' The file containing all EUCAST rules is located here: \url{https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv}.
#'
#' @section Antibiotics:
#' To define antibiotics column names, leave as it is to determine it automatically with \code{\link{guess_ab_col}} or input a text (case-insensitive), or use \code{NULL} to skip a column (e.g. \code{TIC = NULL} to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning.
@@ -141,8 +137,6 @@ EUCAST_VERSION_EXPERT_RULES <- "3.1, 2016"
#' \url{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_9.0_Breakpoint_Tables.xlsx}
#' }
#' }
#'
#' For editing the reference file (which is available with \code{\link{eucast_rules_file}}), these values can all be used for target antibiotics: aminoglycosides, tetracyclines, polymyxins, macrolides, glycopeptides, streptogramins, cephalosporins, cephalosporins_without_cfta, carbapenems, aminopenicillins, ureidopenicillins, fluoroquinolones, all_betalactams, and all separate four letter codes like AMC. They can be separated by comma: \code{"AMC, fluoroquinolones"}. The mo_property can be any column name from the \code{\link{microorganisms}} data set, or \code{genus_species} or \code{gramstain}. This file contains references to the 'Burkholderia cepacia complex'. The species in this group can be found in: LiPuma JJ, 2015 (PMID 16217180).
#' @inheritSection AMR Read more on our website!
#' @examples
#' a <- eucast_rules(septic_patients)
@@ -499,7 +493,7 @@ eucast_rules <- function(x,
y[y != "" & y %in% colnames(df)]
}
eucast_rules_df <- eucast_rules_file()
eucast_rules_df <- eucast_rules_file # internal data file
no_of_changes <- 0
for (i in 1:nrow(eucast_rules_df)) {
@@ -754,16 +748,3 @@ eucast_rules <- function(x,
}
}
#' @rdname eucast_rules
#' @importFrom dplyr %>% arrange
#' @export
eucast_rules_file <- function() {
utils::read.delim(file = EUCAST_RULES_FILE_LOCATION,
sep = "\t",
stringsAsFactors = FALSE,
header = TRUE,
strip.white = TRUE,
na = c(NA, "", NULL)) %>%
arrange(reference.rule_group,
reference.rule)
}
+3 -3
View File
@@ -22,11 +22,11 @@
#' Translate strings from AMR package
#'
#' For language-dependent output of AMR functions, like \code{\link{mo_fullname}} and \code{\link{mo_type}}.
#' @details Strings will be translated to foreign languages if they are defined in a local translation file. This file comes with this package and can be found when running:
#' @details Strings will be translated to foreign languages if they are defined in a local translation file. Additions to this file can be suggested at our repository. The file can be found here: \url{https://gitlab.com/msberends/AMR/blob/master/data-raw/translations.tsv}.
#'
#' \code{system.file("translations.tsv", package = "AMR")}
#' Please suggest your own translations \href{https://gitlab.com/msberends/AMR/issues/new?issue[title]=Translation\%20suggestion}{by creating a new issue on our repository}.
#'
#' This file will be read by all functions where a translated output can be desired, like all \code{\link{mo_property}} functions (\code{\link{mo_fullname}}, \code{\link{mo_type}}, etc.). Please suggest your own translations \href{https://gitlab.com/msberends/AMR/issues/new?issue[title]=Translation\%20suggestion}{by creating a new issue on our repository}.
#' This file will be read by all functions where a translated output can be desired, like all \code{\link{mo_property}} functions (\code{\link{mo_fullname}}, \code{\link{mo_type}}, etc.).
#'
#' The system language will be used at default, if supported, using \code{\link{get_locale}}. The system language can be overwritten with \code{\link{getOption}("AMR_locale")}.
#' @inheritSection AMR Read more on our website!
+5 -13
View File
@@ -243,9 +243,10 @@ generate_warning_abs_missing <- function(missing, any = FALSE) {
stopifnot_installed_package <- function(package) {
if (!package %in% base::rownames(utils::installed.packages())) {
stop("this function requires the ", package, " package.", call. = FALSE)
}
# no "utils::installed.packages()" since it requires non-staged install since R 3.6.0
# https://developer.r-project.org/Blog/public/2019/02/14/staged-install/index.html
get(".packageName", envir = asNamespace(package))
return(invisible())
}
# translate strings based on inst/translations.tsv
@@ -262,16 +263,7 @@ t <- function(from, language = get_locale()) {
return(from)
}
df_trans <- utils::read.table(file = system.file("translations.tsv", package = "AMR"),
sep = "\t",
stringsAsFactors = FALSE,
header = TRUE,
blank.lines.skip = TRUE,
fill = TRUE,
strip.white = TRUE,
encoding = "UTF-8",
fileEncoding = "UTF-8",
na.strings = c(NA, "", NULL))
df_trans <- translations_file # internal data file
if (!language %in% df_trans$lang) {
stop("Unsupported language: '", language, "' - use one of: ",
+2 -2
View File
@@ -191,7 +191,7 @@
#' }
as.mo <- function(x, Becker = FALSE, Lancefield = FALSE, allow_uncertain = TRUE, reference_df = get_mo_source(), ...) {
if (!"AMR" %in% base::.packages()) {
library("AMR")
require("AMR")
# check onLoad() in R/zzz.R: data tables are created there.
}
@@ -295,7 +295,7 @@ exec_as.mo <- function(x,
debug = FALSE) {
if (!"AMR" %in% base::.packages()) {
library("AMR")
require("AMR")
# check onLoad() in R/zzz.R: data tables are created there.
}
+1 -1
View File
@@ -364,7 +364,7 @@ mo_validate <- function(x, property, ...) {
}
if (!"AMR" %in% base::.packages()) {
library("AMR")
require("AMR")
# check onLoad() in R/zzz.R: data tables are created there.
}
BIN
View File
Binary file not shown.
File renamed without changes.
Internal Server Error - Gitea RUG
500 Internal Server Error

An error occurred:

An error occurred