diff --git a/R/data_xtabulate.R b/R/data_xtabulate.R index f392cae6b..3c6ec9b44 100644 --- a/R/data_xtabulate.R +++ b/R/data_xtabulate.R @@ -318,6 +318,10 @@ print_html.dw_data_xtabulates <- function(x, big_mark = NULL, ...) { # provided, e.g. "weights = iris$not_found" - all this is only relevant when # weights is NULL if (is.null(weights)) { + + # possibly misspelled weights-variables for default-method ---------------- + # ------------------------------------------------------------------------- + # do we have any value for weights_expression? if (!is.null(weights_expression) && # due to deparse() and substitute, NULL becomes "NULL" - we need to check for this @@ -339,6 +343,10 @@ print_html.dw_data_xtabulates <- function(x, big_mark = NULL, ...) { insight::format_error("The variable specified in `weights` was not found. Possibly misspelled?") } } else { + + # possibly misspecified weights-variables for data.frame-method ----------- + # ------------------------------------------------------------------------- + if (is.character(weights)) { # If "weights" is a character string, must be of length 1 if (length(weights) > 1) {