# All good
check_no_formula_duplication(y ~ x)
# Not good!
check_no_formula_duplication(y ~ y)
# This is generally okay
check_no_formula_duplication(y ~ log(y))
# But you can be more strict
check_no_formula_duplication(y ~ log(y), original = TRUE)
# This would throw an error
try(validate_no_formula_duplication(log(y) ~ log(y)))
Run the code above in your browser using DataLab