[R] count occurrence and distance of characters in string

2010-11-04 Thread Immanuel
Hello all, I want to know how often one character occurs in a given string and the distance from between every two occurences. (distance = other characters between them). thanks __ R-help@r-project.org mailing list

Re: [R] count occurrence and distance of characters in string

2010-11-04 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Immanuel Sent: Thursday, November 04, 2010 3:42 PM To: r-help@r-project.org Subject: [R] count occurrence and distance of characters in string Hello all, I want to know how

Re: [R] count occurrence and distance of characters in string

2010-11-04 Thread Charles C. Berry
On Thu, 4 Nov 2010, Immanuel wrote: Hello all, I want to know how often one character occurs in a given string and the distance from between every two occurences. (distance = other characters between them). You should provide commented, minimal, self-contained, reproducible code as asked.

Re: [R] count occurrence and distance of characters in string

2010-11-04 Thread Immanuel
Hey, thanks for the answer, actually I already typed an example but deleted it since I thought it's superfluous. regards - string - kjokllokkoadddo # f1(string, o) should return that o was found 4 times # f2(string, o) should return that the distances between the o's found is 3 , 2, 4

Re: [R] count occurrence and distance of characters in string

2010-11-04 Thread Charles C. Berry
On Fri, 5 Nov 2010, Immanuel wrote: Hey, thanks for the answer, actually I already typed an example but deleted it since I thought it's superfluous. regards - string - kjokllokkoadddo # f1(string, o) should return that o was found 4 times # f2(string, o) should return that the

Re: [R] count occurrence and distance of characters in string

2010-11-04 Thread David Winsemius
On Nov 4, 2010, at 8:06 PM, Charles C. Berry wrote: On Fri, 5 Nov 2010, Immanuel wrote: Hey, thanks for the answer, actually I already typed an example but deleted it since I thought it's superfluous. regards - string - kjokllokkoadddo # f1(string, o) should return that o was

Re: [R] count occurrence and distance of characters in string

2010-11-04 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Immanuel Sent: Thursday, November 04, 2010 4:54 PM To: Charles C. Berry Cc: r-help@r-project.org Subject: Re: [R] count occurrence and distance of characters in string Hey,