Re: [R] regular expressions, sub

From: paul sorenson <sourceforge_at_metrak.com>
Date: Fri 27 Jan 2006 - 22:16:19 EST

There are some interactive regex tools around. I use a python one sometimes. You just then have to be careful re escaping and the style of regular expressions used in the tool you worked with and the target environment.

Christian Hoffmann wrote:
> Hi,
>
> I am trying to use sub, regexpr on expressions like
>
> log(D) ~ log(N)+I(log(N)^2)+log(t)
>
> being a model specification.
>
> The aim is to produce:
>
> "ln D ~ ln N + ln^2 N + ln t"
>
> The variable names N, t may change, the number of terms too.
>
> I succeded only partially, help on regular expressions is hard to
> understand for me, examples on my case are rare. The help page on R-help
> for grep etc. and "regular expressions"



R-help@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 Received on Fri Jan 27 23:07:18 2006

This archive was generated by hypermail 2.1.8 : Sat 28 Jan 2006 - 02:16:38 EST