"Romain Lorrilliere" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
Hi,

do you know, a method to convert an decimal value (integer) to the
corresponding hexadecimal value ?

Starting in R 2.1.0, sprintf can be used:

> x <- c(0, 65535, 65536, 305419896, 2^31-1)
> y <- sprintf("0x%X", x)
> y
[1] "0x0"        "0xFFFF"     "0x10000"    "0x12345678" "0x7FFFFFFF"
> as.numeric(y)
[1]          0      65535      65536  305419896 2147483647

efg

Earl F. Glynn
Scientific Programmer
Stowers Institute for Medical Research

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to