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

From: <ripley_at_stats.ox.ac.uk>
Date: Mon 17 Apr 2006 - 14:48:42 GMT


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@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@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>

-- 
Brian D. Ripley,                  ripley@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

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Tue Apr 18 00:50:40 2006

This archive was generated by hypermail 2.1.8 : Mon 17 Apr 2006 - 16:17:58 GMT