Re: [R] String manipulation and formatting

From: Christos Hatzis <>
Date: Tue 18 Jul 2006 - 00:39:06 EST

Ok. You needed the format string.  

xify(4.1) would be equivalent to the following:  


It should be straightforward to write the wrapper function for this.  

HTH.   -Christos

From: Bashir Saghir (Aztek Global) [] Sent: Monday, July 17, 2006 10:39 AM
To: ''; Subject: RE: [R] String manipulation and formatting


I should have been clearer. The output is the string "XXX.XX" and "XXX".

So xify(4.1) should produce "XXX.X" as character string.

Any pointers? Or did I miss something with formatC?

-----Original Message-----
From: Christos Hatzis [] Sent: Monday, July 17, 2006 16:21
To: Bashir Saghir (Aztek Global); Subject: RE: [R] String manipulation and formatting

See ?formatC

You might need to write a simple wrapper function to implement the interface

that you want.


-----Original Message-----
[] On Behalf Of Bashir Saghir (Aztek Global)
Sent: Monday, July 17, 2006 10:07 AM
To: ''
Subject: [R] String manipulation and formatting

I'm trying to write a simple function that does the following:

[command] xify(5.2)
[output] XXX.XX

[command] xify(3)
[output] XXX

Any simple solutions (without using python/perl/unix script/...)?


Legal Notice: This electronic mail and its attachments are i...{{dropped}} mailing list PLEASE do read the posting guide! Received on Tue Jul 18 00:50:06 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 18 Jul 2006 - 02:19:41 EST.

Mailing list information is available at Please read the posting guide before posting to the list.