Re: [R] R string functions

2011-06-15 Thread karena
Thank all you guys for the great help~. I appreciate -- View this message in context: http://r.789695.n4.nabble.com/R-string-functions-tp3600484p3600975.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] R string functions

2011-06-15 Thread Steve Lianoglou
Hi, On Wed, Jun 15, 2011 at 4:37 PM, karena wrote: > Hi, > > I have a string "GGCCCAATCGCAATTCCAATT" > > What I want to do is to count the percentage of each letter in the string, > what string functions can I use to count the number of each letter appearing > in the string? > > For example,

Re: [R] R string functions

2011-06-15 Thread Peter Alspach
a.m. > To: r-help@r-project.org > Subject: [R] R string functions > > Hi, > > I have a string "GGCCCAATCGCAATTCCAATT" > > What I want to do is to count the percentage of each letter in the > string, > what string functions can I use to count the number of

[R] R string functions

2011-06-15 Thread karena
;T" appeared 5 times, how can I use a string function to get the these number? thanks, karena -- View this message in context: http://r.789695.n4.nabble.com/R-string-functions-tp3600484p3600484.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] R string functions

2011-06-15 Thread Daniel Malter
to count the number of each letter > appearing in the string? > > For example, the letter "A" appeared 6 times, letter "T" appeared 5 times, > how can I use a string function to get the these number? > > thanks, > > karena > -- View this message in c

Re: [R] string functions

2010-01-09 Thread Ista Zahn
Maybe I don't understand the question. I can think of four ways to count, none of which give me 7: a <- "Hello World" b <- "Hello Peter" #counting duplicates and the space: sa <- strsplit(a, split="")[[1]] sb <- strsplit(b, split="")[[1]] length(which(sb %in% sa == TRUE)) #counting the space but

Re: [R] string functions

2010-01-09 Thread Greg Hirson
Laetitia, One approach: lettermatch <- function(stringA, stringB) { sum(unique(unlist(strsplit(stringA, ""))) %in% unique(unlist(strsplit(stringB, "" } lettermatch("Hello World","Hello Peter") yields 6, as the l is only singly counted. This treats uppercase and lowercase as different

Re: [R] string functions

2010-01-09 Thread Liviu Andronic
On 1/9/10, Laetitia Schmid wrote: > Does anybody know a string function that would calculate how many characters > two strings share? I.e. ("Hello World","Hello Peter") would be 7. > Perhaps package ‘stringr’ has something related? Liviu __ R-help@r-p

[R] string functions

2010-01-09 Thread Laetitia Schmid
Hi! Does anybody know a string function that would calculate how many characters two strings share? I.e. ("Hello World","Hello Peter") would be 7. Thanks. Laetitia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PL

Re: [R] string functions

2008-09-14 Thread David Winsemius
On Sep 14, 2008, at 1:53 PM, zubin wrote: Hello, trying to locate all the string commands in the base version of R, can't seem to find an area that describes them. I am in need to do some serious parsing of text data to create my dataset. Is there a summary link to all the character opera

Re: [R] string functions

2008-09-14 Thread Gabor Grothendieck
Try this: help.search(keyword = "character", package = "base") Then read each of the pages listed to get info on the indicated command plus related commands also described on those pages (but not necessarily listed in the help.search list). You might also want to look at the gsubfn package and

Re: [R] string functions

2008-09-14 Thread jim holtman
Start with ?grep and then follow the "See Also". Exactly what type of serious parsing are you trying to do? R can do some, but if it is very complex, you might want to consider awk/perl. On Sun, Sep 14, 2008 at 1:53 PM, zubin <[EMAIL PROTECTED]> wrote: > Hello, trying to locate all the string

Re: [R] string functions

2008-09-14 Thread David Winsemius
On Sep 14, 2008, at 1:53 PM, zubin wrote: Hello, trying to locate all the string commands in the base version of R, can't seem to find an area that describes them. I am in need to do some serious parsing of text data to create my dataset. Is there a summary link to all the character opera

[R] string functions

2008-09-14 Thread zubin
Hello, trying to locate all the string commands in the base version of R, can't seem to find an area that describes them. I am in need to do some serious parsing of text data to create my dataset. Is there a summary link to all the character operators? string manipulations that would help in