1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 16:42:10 +02:00

(v1.7.1.9005) ab class selectors for R-3.0 and R-3.1

This commit is contained in:
2021-06-22 12:16:42 +02:00
parent c44d9392ca
commit d04e83f494
41 changed files with 227 additions and 279 deletions

View File

@ -747,16 +747,14 @@ mo_validate <- function(x, property, language, ...) {
find_mo_col <- function(fn) {
# this function tries to find an mo column in the data the function was called in,
# which is useful when functions are used within dplyr verbs
df <- get_current_data(arg_name = "x",
call = -3,
reuse_from_1st_call = FALSE) # will return an error if not found
df <- get_current_data(arg_name = "x", call = -3) # will return an error if not found
mo <- NULL
try({
mo <- suppressMessages(search_type_in_df(df, "mo"))
}, silent = TRUE)
if (!is.null(df) && !is.null(mo) && is.data.frame(df)) {
if (message_not_thrown_before(fn = fn)) {
message_("Using column '", font_bold(mo), "' as input for ", fn, "()")
message_("Using column '", font_bold(mo), "' as input for `", fn, "()`")
remember_thrown_message(fn = fn)
}
return(df[, mo, drop = TRUE])