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:
@ -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])
|
||||
|
Reference in New Issue
Block a user