Skip to content

Commit

Permalink
comment to structure
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Mar 7, 2024
1 parent 1597f84 commit 59ce510
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions R/data_xtabulate.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down

0 comments on commit 59ce510

Please sign in to comment.