R/formula-utils.R
reop_formula.Rdmodel.frame() assumes that certain operations (e.g. /, *, ^) have special
meanings. These can be inhibited using I(). This function inserts I() into
a formula when encountering a specified operator or parens.
reop_formula(x, ops = c("/", "*", "^"))a formula with I() inserted where required to inhibit interpretation/conversion.
reop_formula(y ~ x * y)
#> y ~ I(x * y)
#> <environment: 0x55c196f46638>
reop_formula(y ~ (x * y))
#> y ~ I(x * y)
#> <environment: 0x55c196f46638>
reop_formula(y ~ x ^ y)
#> y ~ I(x^y)
#> <environment: 0x55c196f46638>
reop_formula(y ~ x * y ^ z)
#> y ~ I(x * y^z)
#> <environment: 0x55c196f46638>