[R] Binary information convert into hexadecimal

Schmitt, Corinna Corinna.Schmitt at igb.fraunhofer.de
Fri Mar 23 13:30:10 CET 2007


Hallo,

I just started with programming with R. I have the following problem:

Given is binary information and should be translated into integer and
afterwards into hexadecimal:

0000  0  0
0001  1  1
0010  2  2
0011  3  3
0100  4  4
0101  5  5
0110  6  6
0111  7  7
1000  8  8 
1001  9  9
1010 10  A
1011 11  B
1100 12  C
1101 13  D
1110 14  E
1111 15  F


I found a similar function for translating an integer vector into
characters and back to integer (z=0:9; digits=as.character(z);
d=as.integer(digits)).
My idea was to make a kind of case-task as I know from RUBY. But there
should exits an easier way.

Can anyone help me?

Corinna



More information about the R-help mailing list