[R] strsplit behavior

Niels Waller niels.waller at vanderbilt.edu
Mon Dec 17 18:54:00 CET 2001



I am trying (with no success) to split a string at a period. Should I be
using a different function?


This is my string
> x<-"a6502.1"


This works fine.
> strsplit(x,"2")
[[1]]
[1] "a650" ".1"

This also works fine.
> strsplit(x,"1")
[[1]]
[1] "a6502."


But this seems strange
> strsplit(x,".")
[[1]]
[1] "" "" "" "" "" "" ""


Niels


0=================================================0
Dr. Niels G. Waller
Quantitative Methods
Department of Psychology and Human Development
Box 512 Peabody College
Vanderbilt University
Nashville TN 37203
email:  niels.waller at vanderbilt.edu
fax:    615 343-9494
QME home page: http://www.vanderbilt.edu/quantmetheval
http://peabody.vanderbilt.edu/depts/psych_and_hd/faculty/wallern/
0=================================================0

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list