(v3.0.1.9035) fix loading in Positron

This commit is contained in:
dr. M.S. (Matthijs) Berends committed 2026-03-18 10:32:11 +01:00
1 parent 4dc3ec0008
commit 8439e9c1d2
3 files changed
+7 -6

No files matched your search

+2 -2
View File
@@ -1,6 +1,6 @@
Package: AMR Package: AMR
Version: 3.0.1.9034 Version: 3.0.1.9035
Date: 2026-03-11 Date: 2026-03-18
Title: Antimicrobial Resistance Data Analysis Title: Antimicrobial Resistance Data Analysis
Description: Functions to simplify and standardise antimicrobial resistance (AMR) Description: Functions to simplify and standardise antimicrobial resistance (AMR)
data analysis and to work with microbial and antimicrobial properties by data analysis and to work with microbial and antimicrobial properties by
+1 -1
View File
@@ -1,4 +1,4 @@
# AMR 3.0.1.9034 # AMR 3.0.1.9035
### New ### New
* Integration with the **tidymodels** framework to allow seamless use of SIR, MIC and disk data in modelling pipelines via `recipes` * Integration with the **tidymodels** framework to allow seamless use of SIR, MIC and disk data in modelling pipelines via `recipes`
+4 -3
View File
@@ -387,10 +387,11 @@ import_fn <- function(name, pkg, error_on_fail = TRUE) {
if (isTRUE(error_on_fail)) { if (isTRUE(error_on_fail)) {
stop_ifnot_installed(pkg) stop_ifnot_installed(pkg)
} }
if (pkg == "rstudioapi" && tryCatch(!rstudioapi::isAvailable(), error = function(e) TRUE)) { if (pkg == "rstudioapi" && !in_rstudio()) {
# only allow rstudioapi to be imported if RStudio is available # only allow rstudioapi to be imported if we're in RStudio
return(NULL) return(NULL)
} }
tryCatch( tryCatch(
# don't use get() to avoid fetching non-API functions # don't use get() to avoid fetching non-API functions
getExportedValue(name = name, ns = asNamespace(pkg)), getExportedValue(name = name, ns = asNamespace(pkg)),
@@ -514,7 +515,7 @@ word_wrap <- function(...,
) )
msg <- paste0(parts, collapse = "`") msg <- paste0(parts, collapse = "`")
} }
msg <- gsub("`(.+?)`", font_grey_bg("`\\1`"), msg) # msg <- gsub("`(.+?)`", font_grey_bg("`\\1`"), msg)
# clean introduced whitespace in between fullstops # clean introduced whitespace in between fullstops
msg <- gsub("[.] +[.]", "..", msg) msg <- gsub("[.] +[.]", "..", msg)