s-news
[Top] [All Lists]

Re: edit values

To: <s-news@lists.biostat.wustl.edu>
Subject: Re: edit values
From: "Chalvatzis, Dimitrios (Energy Wholesale)" <Dimitrios.Chalvatzis@eon-uk.com>
Date: Thu, 18 Aug 2005 14:29:07 +0100
Thread-index: AcWj9iUgzNl5piGkRtKWfXsJjRQ0+QAAVU8QAABSEzA=
Thread-topic: [S] edit values

Dimitrios Chalvatzis 
Risk Analyst 
Energy Wholesale/Risk Policies & Methods 
T +44 (0)24 7642 5429 
F +44 (0)24 7642 5479 
Dimitrios.Chalvatzis@eon-uk.com 


-----Original Message-----
From: Chalvatzis, Dimitrios (Energy Wholesale) 
Sent: Thursday, August 18, 2005 2:28 PM
To: 'jose Bartolomei'
Subject: RE: [S] edit values

Jose,

If we assume that your character vector is saved in object 'a' then the
following line should do the job:

replace(a,which(nchar(a)==7),paste(0,a[nchar(a)==7],sep=""))

HPH

Dimitrios Chalvatzis 
Risk Analyst 
Energy Wholesale/Risk Policies & Methods 
T +44 (0)24 7642 5429 
F +44 (0)24 7642 5479 
Dimitrios.Chalvatzis@eon-uk.com 


-----Original Message-----
From: s-news-owner@lists.biostat.wustl.edu
[mailto:s-news-owner@lists.biostat.wustl.edu] On Behalf Of jose
Bartolomei
Sent: Thursday, August 18, 2005 2:10 PM
To: s-news@lists.biostat.wustl.edu
Subject: [S] edit values

Dear S-Plus users,

I have a character column within a data set that has values with 7 and 8

characters of length.

Which is your recommended way to add a "0" at the left of those values
with 
7 characters only?


Thanks in advance,
Jose
Research degree student
London School Hygiene & Tropical Medicine (LSHTM)


--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu.  To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message:  unsubscribe s-news
___________________________ Disclaimer Notice ____________________
This message and any attachments are confidential and should only 
be read by those to whom they are addressed. If you are not the 
intended recipient, please contact us, delete the message from your
computer and destroy any copies. Any distribution or copying without
our prior permission is prohibited.

Internet communications are not always secure and therefore the 
E.ON Group does not accept legal responsibility for this message.
The recipient is responsible for verifying its authenticity before
acting on the contents. Any views or opinions presented are solely
those of the author and do not necessarily
represent those of the E.ON Group.

E.ON UK plc, Westwood Way, Westwood Business Park,
Coventry, CV4 8LG.
Registered in England & Wales No. 2366970

E.ON UK Trading Ltd, Westwood Way, Westwood Business Park,
Coventry, CV4 8LG
Registered in England & Wales No. 4178314

E.ON UK Trading Ltd is regulated by the Financial Services 
Authority to carry out investment activities.

Telephone +44 (0) 2476 42 4000
Fax +44 (0) 2476 42 5432

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