[R] convert "1", "10", and "100" to "0001", "0010", "0100" etc.

Peter Dalgaard pdalgd at gmail.com
Sat Sep 11 10:55:55 CEST 2010


On 09/11/2010 05:00 AM, Peng, C wrote:
> 
> Thanks David. 
> func() simply prints out the 0010 as a text value. It is still not numeric.
> I am just curious about it.
> 
>> is.numeric(func4(0100))
> 00100[1] FALSE
> 
> 

Well, you can look at the kind of things as.octmode & friends do.

The only thing you can do is to change the print method; internally
there can be no difference between the representation of 10 and 010.


-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list