[R] Find and remove matching parentheses

Gabor Grothendieck ggrothendieck at gmail.com
Sun Apr 2 16:24:11 CEST 2006


See:

http://finzi.psych.upenn.edu/R/Rhelp02a/archive/30590.html

On 4/2/06, Dieter Menne <dieter.menne at menne-biomed.de> wrote:
> To create a more end-user readable table captions for modeld, I would like
> to get rid of the I(...) construct in formulae ("what's the hell does the
> I(..) mean in the contrast table")
>
> Example:
>
> effect ~ I(sqrt(nitro))*treat + I(nitro^2)
>
> should giv
>
> effect ~ sqrt(nitro)*treat + nitro^2
>
> In know, this is a dumb model, just my test case. As far I remember, finding
> matching parentheses is nasty in regexp, so I resorted to a loop and
> counting opening/closing.
>
> Is there a more elegant solution?
>
> Dieter
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list