You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Export a utility that is the top section of .generic_selector(): a predicate indicating whether or not the table/var_info data has been registered.
.generic_selector<-function(variable_column, select_column, select_expr, fun_name) {
# ensuring the proper data has been scoped to use this functionif (!exists("df_var_info", envir=env_variable_type) ||
(exists("df_var_info", envir=env_variable_type) &&!all(c(variable_column, select_column) %in% names(env_variable_type$df_var_info)))) {
cli_alert_danger("Cannot use selector '{fun_name}()' in this context.")
stop("Invalid syntax", call.=FALSE)
}
# selecting the variable from the variable information data frameenv_variable_type$df_var_info %>%
dplyr::select(all_of(c(variable_column, select_column))) %>%
dplyr::filter(stats::complete.cases(.)) %>%
dplyr::filter({{ select_expr }}) %>%
dplyr::pull(all_of(variable_column)) %>%
unique()
}
is_selector_registered<-function(variable_column, select_column) {
!exists("df_var_info", envir=env_variable_type) ||
(exists("df_var_info", envir=env_variable_type) &&!all(c(variable_column, select_column) %in% names(env_variable_type$df_var_info)))
}
The text was updated successfully, but these errors were encountered:
ddsjoberg
changed the title
Export is_selector_registererd() function
Export is_selector_registered() function
Jun 23, 2022
Export a utility that is the top section of
.generic_selector()
: a predicate indicating whether or not the table/var_info data has been registered.The text was updated successfully, but these errors were encountered: