Quantcast

Find and remove matching parentheses

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Find and remove matching parentheses

Dieter Menne
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Find and remove matching parentheses

Gabor Grothendieck
See:

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

On 4/2/06, Dieter Menne <[hidden email]> 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
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Loading...