s-news
[Top] [All Lists]

[S] substring<- and generalization of regexpr

To: s-news <s-news@wubios.wustl.edu>
Subject: [S] substring<- and generalization of regexpr
From: Frank E Harrell Jr <fharrell@virginia.edu>
Date: Fri, 15 Sep 2000 14:33:34 -0400
Organization: University of Virginia
Sender: owner-s-news@wubios.wustl.edu
In S-Plus 6.0 beta 2 (and probably 5.x), 
substring(x, c(1,3), c(1,3)) <- 'x'
for example will result in a vector of 2 character strings even if
x is a character string having one element.  I think the
proper behavior should be to do multiple replacements within
a single character string, resulting in a one-vector.

Also, has anyone implemented a search/replace/regular expression
function that generalizes regexpr()?
-- 
Frank E Harrell Jr              Prof. of Biostatistics & Statistics
Div. of Biostatistics & Epidem. Dept. of Health Evaluation Sciences
U. Virginia School of Medicine  http://hesweb1.med.virginia.edu/biostat
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>