1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-09 21:01:58 +02:00

(v1.5.0.9016) only_rsi_columns update, documentation

This commit is contained in:
2021-02-08 14:18:42 +01:00
parent 8fda473e49
commit 4a84894f79
88 changed files with 654 additions and 375 deletions

View File

@ -675,7 +675,18 @@ get_current_data <- function(arg_name, call) {
# nothing worked, so:
if (is.na(arg_name)) {
stop_("this function must be used inside valid dplyr selection verbs or inside a data.frame call",
if (isTRUE(is.numeric(call))) {
fn <- as.character(sys.call(call + 1)[1])
examples <- paste0(", e.g.:\n",
" your_data %>% select(", fn, "())\n",
" your_data %>% select(column_a, column_b, ", fn, "())\n",
" your_data[, ", fn, "()]\n",
' your_data[, c("column_a", "column_b", ', fn, "())]")
} else {
examples <- ""
}
stop_("this function must be used inside valid dplyr selection verbs or inside a data.frame call",
examples,
call = call)
} else {
stop_("argument `", arg_name, "` is missing with no default", call = call)
@ -721,6 +732,11 @@ get_current_column <- function() {
}
}
is_null_or_grouped_tbl <- function(x) {
# attribute "grouped_df" might change at one point, so only set in one place; here.
is.null(x) || inherits(x, "grouped_tbl")
}
unique_call_id <- function(entire_session = FALSE) {
if (entire_session == TRUE) {
c(envir = "session",