Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions R/process_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,20 @@ process_data <- function(
}
}
# Warn user when group not indexed in data
if (!is.null(group) && group %notin% index_variables) {
if (group != "none") {
cli::cli_alert_warning("{group} not an index of data.")
# reset group to NULL so it's not added to grouping incorrectly
group <- NULL
}
}
# if (!is.null(group) && group %notin% index_variables) {
# if (group != "none") {
# cli::cli_alert_warning("{group} not an index of data.")
# # reset group to NULL so it's not added to grouping incorrectly
# group <- NULL
# }
# }
# Set group_var to identified grouping
if (!is.null(group) && group != "none") {
data <- dplyr::mutate(
dat,
group_var = .data[[group]]
)
if (group %notin% index_variables) index_variables <- c(group, index_variables)
} else {
data <- dat
}
Expand Down
Loading