[Rd] (PR#8777) strsplit does [not] return correct value when

ripley at stats.ox.ac.uk ripley at stats.ox.ac.uk
Mon Apr 17 16:48:42 CEST 2006


Please use a current version of R: we are at 2.3.0RC (and we do ask you 
not to report on obselete versions).

What rule are you using, and where did you find it in the R documentation?

In fact

> strsplit("", " ")
[[1]]
character(0)

which is not as you stated.   This is a feature, as it distinct from

> strsplit(" ", " ")
[[1]]
[1] ""

Consider also

> strsplit("", "")
[[1]]
character(0)

> strsplit("a", "")
[[1]]
[1] "a"

> strsplit("ab", "")
[[1]]
[1] "a" "b"


On Mon, 17 Apr 2006, charles.dupont at vanderbilt.edu wrote:

> Full_Name: Charles Dupont
> Version: 2.2.0
> OS: linux
> Submission from: (NULL) (160.129.129.136)
>
>
> when
>
> strsplit("", " ")
>
> returns character(0)
>
> where as
>
> strsplit("a", " ")
>
> returns "a".
>
> these return values are not constiant with each other.
>
> Charles Dupont
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-devel mailing list