From 8439e9c1d29f70381b270155f6368902c7582c11 Mon Sep 17 00:00:00 2001 From: Matthijs Berends Date: Wed, 18 Mar 2026 10:32:11 +0100 Subject: [PATCH] (v3.0.1.9035) fix loading in Positron --- DESCRIPTION | 4 ++-- NEWS.md | 2 +- R/aa_helper_functions.R | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3f0643be7..2a0c9e10d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 3.0.1.9034 -Date: 2026-03-11 +Version: 3.0.1.9035 +Date: 2026-03-18 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) data analysis and to work with microbial and antimicrobial properties by diff --git a/NEWS.md b/NEWS.md index 26fa78716..ac9a03389 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 3.0.1.9034 +# AMR 3.0.1.9035 ### New * Integration with the **tidymodels** framework to allow seamless use of SIR, MIC and disk data in modelling pipelines via `recipes` diff --git a/R/aa_helper_functions.R b/R/aa_helper_functions.R index ae9217912..a64529ff8 100644 --- a/R/aa_helper_functions.R +++ b/R/aa_helper_functions.R @@ -387,10 +387,11 @@ import_fn <- function(name, pkg, error_on_fail = TRUE) { if (isTRUE(error_on_fail)) { stop_ifnot_installed(pkg) } - if (pkg == "rstudioapi" && tryCatch(!rstudioapi::isAvailable(), error = function(e) TRUE)) { - # only allow rstudioapi to be imported if RStudio is available + if (pkg == "rstudioapi" && !in_rstudio()) { + # only allow rstudioapi to be imported if we're in RStudio return(NULL) } + tryCatch( # don't use get() to avoid fetching non-API functions getExportedValue(name = name, ns = asNamespace(pkg)), @@ -514,7 +515,7 @@ word_wrap <- function(..., ) msg <- paste0(parts, collapse = "`") } - msg <- gsub("`(.+?)`", font_grey_bg("`\\1`"), msg) + # msg <- gsub("`(.+?)`", font_grey_bg("`\\1`"), msg) # clean introduced whitespace in between fullstops msg <- gsub("[.] +[.]", "..", msg)