Re: [R] position of a specific character

From: Erik Iverson <iverson_at_biostat.wisc.edu>
Date: Mon, 14 Jul 2008 18:03:36 -0500

gregexpr("\\(", frg)

Hua Li wrote:
> Hi All,
>
> I'm wondering whether there is a quick way to know the position of a
> specific charcater in a long character:
>
> for example
>
> frg="((D:41.04,I:41.04):45.05,(((E:2.32,((G:0.67,J:0.67):0.44,H:1.11):1.21)"
>
>
> and I would like to know that the 1st, 2nd, 26th, 27th, 28th ...
> character is "(", is there a quick way to do that?
>
> Thanks!
>
> Hua
>
> ______________________________________________ R-help_at_r-project.org
> mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do
> read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 14 Jul 2008 - 23:16:48 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 15 Jul 2008 - 08:31:53 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive