Closes #182
Related to #175, as we also used expr_contains() there
In the original example in #182, we would detect species as a factor column, and then in detect_factorish_in_functions() we would grepl() that against the non-factor expressions in the terms object, which included the expression that was just: xxspeciesxx, so it looked like species was part of an inline function.
We no longer use grepl(), instead moving to the (hopefully) more robust approach of iterating through the components of the expression with expr_contains() and checking them exactly.
We modified expr_contains() here to disallow matching function names in case a user has a factor column that is named the same as an inline function they used. This should be rare anyways, but seemed like a good check. We didn't have this before because we were checking for :, which was the actual function name.
This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.
Closes #182 Related to #175, as we also used
expr_contains()
thereIn the original example in #182, we would detect
species
as a factor column, and then indetect_factorish_in_functions()
we wouldgrepl()
that against the non-factor expressions in the terms object, which included the expression that was just:xxspeciesxx
, so it looked likespecies
was part of an inline function.We no longer use
grepl()
, instead moving to the (hopefully) more robust approach of iterating through the components of the expression withexpr_contains()
and checking them exactly.We modified
expr_contains()
here to disallow matching function names in case a user has a factor column that is named the same as an inline function they used. This should be rare anyways, but seemed like a good check. We didn't have this before because we were checking for:
, which was the actual function name.