| To: | s-news <s-news@lists.biostat.wustl.edu> |
|---|---|
| Subject: | pattern |
| From: | "Pravin Jadhav" <pravinj@gmail.com> |
| Date: | Tue, 16 May 2006 11:47:59 -0400 |
| Domainkey-signature: | a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=heIox5J6X8GLs1usqFh80W7HrJA9ZZYVxZ1pmQtvTUCeL/94l0jPEdlxkynrOGraBQgIsTO9EyI0/93tRPIW7BwMHnihlM4k0GGnhb8M7QYf0OplPyXTshjc8ExJfcVidDKHjM5NGImHqfb1NzbJ87tOu3lzLuITziaypNS/I/k= |
|
Hello,
I have the following vector
> test1<-c("A+B", "A+C+D", "A+G+B")
I am interested in knowing the number of letters in each character string. The output should be (2, 3, 3).
I can do this when there is no "+" sign in between
>test2<-c("AB","ACD","AGB")
>attr(regexpr("[A-Z]+",test2), "match.length")
[1] 2 3 3
I am wondering how to obtain similar output for "test1". Any pointers are appreciated.
Pravin
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: ODBC question, ONKELINX, Thierry |
|---|---|
| Next by Date: | Re: pattern, Chalvatzis, Dimitrios (Energy Wholesale) |
| Previous by Thread: | ODBC question, Ita . Cirovic-Donev |
| Next by Thread: | Re: pattern, Dimitrios Rizopoulos |
| Indexes: | [Date] [Thread] [Top] [All Lists] |