[R] a decimal aligned column

BBands bbands at gmail.com
Thu Sep 28 21:31:40 CEST 2006


Hello,

For numbers in the range 100 to 100,000,000 I'd like to decimal align
a right-justified comma-delineated column of numbers, but I haven't
been able to work out the proper format statement. format(num,
justify=right, width=15, big.mark=",") gets me close, but numbers
larger than 1,000,000 project a digit beyond the right edge of the
column, which I really don't understand. I gather I can get the
decimal alignment from sprintf(), but I am not sure about the
interaction of the two functions.

TIA,

    jab
-- 
John Bollinger, CFA, CMT
www.BollingerBands.com

If you advance far enough, you arrive at the beginning.



More information about the R-help mailing list