s-news
[Top] [All Lists]

RE: [S] substring<- and generalization of regexpr

To: s-news <s-news@wubios.wustl.edu>, "'Frank E Harrell Jr'" <fharrell@virginia.edu>
Subject: RE: [S] substring<- and generalization of regexpr
From: "Gunter, Bert" <bert_gunter@merck.com>
Date: Fri, 15 Sep 2000 16:09:21 -0400
Sender: owner-s-news@wubios.wustl.edu
Frank, all:

In SP 2000 the code results in a one string vector with  multiple
replacements as you describe.

-- Bert


Bert Gunter
Biometrics Research RY 70-38
Merck & Company
P.O. Box 2000
Rahway, NJ 07065-0900
Phone: (732) 594-7765
mailto: bert_gunter@merck.com

"The business of the statistician is to catalyze the scientific learning
process."      -- George E.P. Box

> ----------
> From:         Frank E Harrell Jr[SMTP:fharrell@virginia.edu]
> Sent:         Friday, September 15, 2000 2:33 PM
> To:   s-news
> Subject:      [S] substring<- and generalization of regexpr
> 
> s
> 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.
> 
-----------------------------------------------------------------------
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>