Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

reop_formula

Insert Inhibition of Interpretation/Conversion into formulas


Description

model.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.

Usage

reop_formula(x, ops = c("/", "*", "^"))

Arguments

x

a formula (or a call of length 2 or 3, for recursive processing of formulas). Other objects are returned unchanged.

ops

a vector of character representions of operators to be inhibited.

Value

a formula with I() inserted where required to inhibit interpretation/conversion.

Examples

reop_formula(y ~ x * y)
reop_formula(y ~ (x * y))
reop_formula(y ~ x ^ y)
reop_formula(y ~ x * y ^ z)

mosaicCore

Common Utilities for Other MOSAIC-Family Packages

v0.9.0
GPL (>= 2)
Authors
Randall Pruim <rpruim@calvin.edu>, Daniel T. Kaplan <kaplan@macalester.edu>, Nicholas J. Horton <nhorton@amherst.edu>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.