1
0
mirror of https://github.com/msberends/AMR.git synced 2026-01-21 02:04:35 +01:00

(v3.0.1.9018) fixes #249

updates AB groups
This commit is contained in:
2026-01-16 10:57:03 +01:00
parent fd50c51543
commit 2df2911cf4
35 changed files with 104 additions and 90 deletions

View File

@@ -1042,24 +1042,8 @@ get_current_column <- function() {
# cur_column() doesn't always work (only allowed for certain conditions set by dplyr), but it's probably still possible:
frms <- lapply(sys.frames(), function(env) {
if (tryCatch(!is.null(env$i), error = function(e) FALSE)) {
if (!is.null(env$tibble_vars)) {
# for mutate_if()
# TODO remove later, was part of older dplyr versions (at least not in dplyr 1.1.4)
env$tibble_vars[env$i]
} else {
# for mutate(across())
if (!is.null(env$data) && is.data.frame(env$data)) {
df <- env$data
} else {
df <- tryCatch(get_current_data(NA, 0), error = function(e) NULL)
}
if (is.data.frame(df)) {
colnames(df)[env$i]
} else {
env$i
}
}
if (all(c("dots", "i") %in% names(env))) {
names(env$dots)[env$i]
} else {
NULL
}