An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090529/36b593e8/attachment-0001.pl>
strsplit
3 messages · Nair, Murlidharan T, Henrique Dallazuanna, Uwe Ligges
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090529/4439eb0f/attachment-0001.pl>
Henrique Dallazuanna wrote:
Try this: unlist(part)[1] or part[[1]][1]
And in order to isnpect your objects, use str(part) at first which tells you about the structure of the object. Then you know you got a list and can look up how to extract a part of a list as Henrique Dallazuanna ponted out already. Uwe Ligges
On Fri, May 29, 2009 at 2:09 PM, Nair, Murlidharan T <mnair at 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 at 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.
------------------------------------------------------------------------
______________________________________________ R-help at 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.