Try this:

unlist(part)[1]

or

part[[1]][1]

On Fri, May 29, 2009 at 2:09 PM, Nair, Murlidharan T <mn...@iusb.edu> wrote:

> I am trying split a string and use one part of it to label graphs. I am
> using strsplit for that. While I am able to split it, how do I access the
> separated parts.
> > filName<-"chrI_2223"
> >part<- strsplit(filName,"\\_")
>  > part
> [[1]]
> [1] "chrI" "2223"
> > part[1]
> [[1]]
> [1] "chrI" "2223"
>
> I looked up the help archive but did not find it. Can someone help me here?
>
> Cheers../Murli
>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to