[R] R

Daniel Nordlund djnordlund at frontier.com
Mon Feb 20 06:25:55 CET 2012


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
> On Behalf Of Steve Lianoglou
> Sent: Sunday, February 19, 2012 8:08 PM
> To: elliot.welch at virgin.net
> Cc: r help
> Subject: Re: [R] R
> 
> Hi,
> 
> When replying to mails from r-help, please hit "reply all" so that
> people can follow along so that everyone can benefit from the help, as
> well as getting more eyeballs on your questions so you get better
> help.
> 
> Now:
> 
> On Sun, Feb 19, 2012 at 8:54 PM,  <elliot.welch at virgin.net> wrote:
> > Brilliant, thanks for the help. Do you know how to find how many pairs
> of letters there are in a vector? For example in AABCCC there would be 3
> pairs?

If I am guessing correctly, this might do what you want. 

x <- "AABCCC"
xx <- unlist(strsplit(x,split=c()))
sum(xx[-6] == xx[-1])

I will let you read the manual that Steve points to below to figure out how the code accomplishes the task.

Dan

> 
> I'm not sure what you mean.
> 
> Please give an example of your input data, and what you expect to get
> out of it, as well as showing us (in code) what you've already tried.
> 
> I get the sense that you're pretty new to R. You're going to have to
> do some homework in order to come up to speed w/ the basics of the
> language. You can start here:
> 
> http://cran.r-project.org/doc/manuals/R-intro.pdf
> 
> HTH,
> -steve
> 
> --
> Steve Lianoglou
> Graduate Student: Computational Systems Biology
>  | Memorial Sloan-Kettering Cancer Center
>  | Weill Medical College of Cornell University
> Contact Info: http://cbio.mskcc.org/~lianos/contact

Daniel Nordlund
Bothell, WA USA



More information about the R-help mailing list