[R] splitstr problem solved
Matthew Wiener
mcw at ln.nimh.nih.gov
Fri Feb 18 22:25:34 CET 2000
Hi. Robert Gentleman's solution works. Thanks.
This seems to be a documentation bug; I will submit a separate report to
the bug list for completeness.
Matt
On Sat, 19 Feb 2000, Robert Gentleman wrote:
> On Fri, Feb 18, 2000 at 02:32:54PM -0500, Matthew Wiener wrote:
> > Hi, all.
> >
> > Using the patched version of R-0.99.0, I cannot reproduce the following
> > example from the strsplit documentation:
> >
> > (Example)
> > unlist(strsplit("a.b.c", "."))
> > ## [1] "" "" "" "" ""
> > ## Note that `split' is a regexp!
> > ## If you really want to split on `.', use
> > unlist(strsplit("a.b.c", "\."))
> > ## [1] "a" "b" "c"
>
> I don't have a copy of 0.99 but I think you want
> unlist(strsplit("a.b.c", "\\."))
> ^^
> >
> >
> > The first one gets the stated result, but the second gets me the same
> > result as the first.
> >
> > Is there some way to do what's intended?
> >
> > Thanks,
> > Matt
> >
> >
> > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> > 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
> > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>
> --
> +-------------------------------------------------------------------------+
> | Robert Gentleman phone : (64-9) 3737-599 ext 3946 |
> | Senior Lecturer fax : (64-9) 3737-018 |
> | Department of Statistics |
> | University of Auckland email : rgentlem at stat.auckland.ac.nz |
> +-------------------------------------------------------------------------+
>
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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