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

David Winsemius dwinsemius at comcast.net
Sat Sep 11 03:55:13 CEST 2010


On Sep 10, 2010, at 9:25 PM, Peng, C wrote:

>
> These are character values. Is there any way to get 001, 010, ...,  
> as actual
> numeric values?

 > 001
[1] 1
 > 0100
[1] 100
 > 001 == 1
[1] TRUE
 > 0100 == 100
[1] TRUE

> -- 
> View this message in context: http://r.789695.n4.nabble.com/convert-1-10-and-100-to-0001-0010-0100-etc-tp2535023p2535296.html
> Sent from the R help mailing list archive at Nabble.com.


--
David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list