cberry@tajo.ucsd.edu
1999-Dec-18 02:47 UTC
strsplit does not conform to documentation (PR#379)
Description:
Split the Strings in `x' into substrings according to
the presence of substring `split' within them.
--------------------
> strsplit("acbdefgSPLIThigkilmnSpPqrst","SPLIT")
[[1]]
[1] "acbdefg" "higkilmn" "p"
"qrst"
--------------------
Apparently, it will
Split the Strings in `x' into substrings according to the presence of
ANY CHARACTER FOUND IN substring `split'.
-------------------
Was this intended? I expected, as the documentation implies that the
result from above would be:
"acbdefg" "higkilmnSpPqrst"
Chuck Berry
--please do not edit the information below--
Version:
platform = sparc-sun-solaris2.7
arch = sparc
os = solaris2.7
system = sparc, solaris2.7
status = Release
major = 0
minor = 65.1
year = 1999
month = October
day = 07
language = R
Search Path:
.GlobalEnv, Autoloads, package:base>
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Peter Dalgaard BSA
1999-Dec-18 20:28 UTC
strsplit does not conform to documentation (PR#379)
cberry@tajo.ucsd.edu writes:> Description: > > Split the Strings in `x' into substrings according to > the presence of substring `split' within them. >> Apparently, it will > > Split the Strings in `x' into substrings according to the presence of > ANY CHARACTER FOUND IN substring `split'. > > ------------------- > > Was this intended? I expected, as the documentation implies that the > result from above would be: > > "acbdefg" "higkilmnSpPqrst"Yes it was intended. Strsplit interfaces to the strtok() C routine, char *strtok(char *s, const char *delim); DESCRIPTION A `token' is a nonempty string of characters not occurring in the string delim, followed by \0 or by a character occurring in delim. and `split' gets passed as `delim'. The documentation is bad, though. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel 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-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._