tidymodels / hardhat

Construct Modeling Packages
https://hardhat.tidymodels.org
Other
101 stars 16 forks source link

Fix for False Identification of an Interaction on LHS in `mold()` #174

Closed ddsjoberg closed 2 years ago

ddsjoberg commented 2 years ago

Pull Request closes #173

Fix allows users to use a package prefix for a function on the LHS of the formula in mold(), e.g. mold(survival::Surv(time, status) ~ age, data = survival::lung)

Previously, the code checked for a colon in the terms. I updated it to use lookahead and lookbehind regular expressions to search for a colon that is neither preceded nor followed by another colon.

Thank you

DavisVaughan commented 2 years ago

@ddsjoberg thanks! We really appreciate your contribution. However, I've decide to solve this a different way over in #175, so I'm going to close this PR. Thanks again!

ddsjoberg commented 2 years ago

Thanks @DavisVaughan ! I am sure your solution is much much much more robust! I'll keep an eye out for the next release of the pkg 🕺🏼 🕺🏼 🕺🏼

github-actions[bot] commented 2 years ago

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.