
Help
I can produce the hexidecimal equivalent of a decimal number but I am having
a hard time reversing the operation. I'm good for hex representations to 159
and am close to extending to 2559. The archives are not clear on the
existence of a function for this task. Is there one?
Here is what I have got so far:
#Good for hex values to "9F"
as.decmode<-function(as.character(x)){
              hexDigit<-c(0:9,LETTERS[1:6])
              z<-matrix(c(strsplit(x, NULL),recursive=T),
              length(x),2,byrow=T)
              z.1<-as.numeric(z[,1])
              z.2<- match(z[,2],hexDigit)-1
              dec<-16*z.1+z.2
              return(dec)
              }
Alex Hanke
Department of Fisheries and Oceans
St. Andrews Biological Station
531 Brandy Cove Road
St. Andrews, NB
Canada
E5B 2L9



	[[alternative HTML version deleted]]


