Skip to content

Commit

Permalink
update contrasts check
Browse files Browse the repository at this point in the history
  • Loading branch information
stemangiola committed Dec 14, 2023
1 parent 7fe748b commit f2026be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -2109,9 +2109,9 @@ mutate_from_expr_list = function(x, formula_expr, ignore_errors = TRUE){
require_back_quotes = contrasts_elements |> str_remove_all("`") |> contains_only_valid_chars_for_column()
has_left_back_quotes = contrasts_elements |> str_detect("^`")
has_right_back_quotes = contrasts_elements |> str_detect("`$")
if_false_not_good = require_back_quotes | (has_left_back_quotes & has_right_back_quotes)
if_true_not_good = require_back_quotes & !(has_left_back_quotes & has_right_back_quotes)

if(!all(if_false_not_good))
if(any(if_true_not_good))
warning(sprintf("sccomp says: for columns which have special characters e.g. %s, you need to use surrounding backquotes ``.", paste(contrasts_elements[!if_false_not_good], sep=", ")))

# Check if columns exist
Expand Down

0 comments on commit f2026be

Please sign in to comment.