mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 04:02:19 +02:00
(v1.4.0.9045) unit tests
This commit is contained in:
@ -296,7 +296,6 @@ word_wrap <- function(...,
|
||||
indentation <- 0 + extra_indent
|
||||
}
|
||||
msg <- gsub("\n", paste0("\n", strrep(" ", indentation)), msg, fixed = TRUE)
|
||||
# msg <- gsub("*|*", paste0("*|*", strrep(" ", indentation)), msg, fixed = TRUE)
|
||||
# remove trailing empty characters
|
||||
msg <- gsub("(\n| )+$", "", msg)
|
||||
|
||||
@ -538,7 +537,7 @@ get_current_data <- function(arg_name, call) {
|
||||
}
|
||||
|
||||
get_root_env_address <- function() {
|
||||
sub('<environment: (.*)>', '\\1', utils::capture.output(sys.frames()[[1]]))
|
||||
sub("<environment: (.*)>", "\\1", utils::capture.output(sys.frames()[[1]]))
|
||||
}
|
||||
|
||||
remember_thrown_message <- function(fn) {
|
||||
|
@ -147,10 +147,12 @@ rsi_calc <- function(...,
|
||||
}
|
||||
|
||||
if (print_warning == TRUE) {
|
||||
if (message_not_thrown_before("rsi_calc")) {
|
||||
warning_("Increase speed by transforming to class <rsi> on beforehand: your_data %pm>% mutate_if(is.rsi.eligible, as.rsi)",
|
||||
# since rsi_calc() is always called from a count() or proportion() function, we use -1:
|
||||
cll <- gsub("[^a-zA-Z0-9_]+", "_", paste(deparse(sys.calls()[[length(sys.calls()) - 1]]), collapse = ""))
|
||||
if (message_not_thrown_before(cll)) {
|
||||
warning_("Increase speed by transforming to class <rsi> on beforehand: your_data %>% mutate_if(is.rsi.eligible, as.rsi)",
|
||||
call = FALSE)
|
||||
remember_thrown_message("rsi_calc")
|
||||
remember_thrown_message(cll)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user