From ripley at stats.ox.ac.uk  Mon Apr 17 16:48:42 2006
From: ripley at stats.ox.ac.uk (ripley at stats.ox.ac.uk)
Date: Mon, 17 Apr 2006 16:48:42 +0200 (CEST)
Subject: [Rd] (PR#8777) strsplit does [not] return correct value when
Message-ID: <20060417144842.5BE3219B38@slim.kubism.ku.dk>

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



[Rd] (PR#8777) strsplit does [not] return correct value when
ripley at stats.ox.ac.uk