Re: [R] Relative frequency on a character vector

2011-01-18 Thread Peter Ehlers
On 2011-01-18 04:51, ADias wrote: Hi, I have this character vector: A<-c("Tell me how many different letter this vector has?") Is there a way with R that it can let me know how many different letters I have on this vector? If I use nchar(A) que gives me the number 50. With this function he i

Re: [R] Relative frequency on a character vector

2011-01-18 Thread Henrique Dallazuanna
Try this: table(strsplit(A, "?")[[1]]) On Tue, Jan 18, 2011 at 10:51 AM, ADias wrote: > > Hi, > > I have this character vector: > > A<-c("Tell me how many different letter this vector has?") > > Is there a way with R that it can let me know how many different letters I > have on this vector? >

[R] Relative frequency on a character vector

2011-01-18 Thread ADias
Hi, I have this character vector: A<-c("Tell me how many different letter this vector has?") Is there a way with R that it can let me know how many different letters I have on this vector? If I use nchar(A) que gives me the number 50. With this function he is counting all the letters present a