[R] Convert ASCII string to Decimal in R (vice versa) was: Hex

Dieter Menne dieter.menne at menne-biomed.de
Mon Dec 22 10:54:36 CET 2008


Gundala Viswanath <gundalav <at> gmail.com> writes:

> Sorry my mistake. I wanted to convert them
> into Decimal (not Hexadecimal).
> 
> Given this string, the desired answer follows:
> 
> > ascii_str  <- "ORQ>IK"
> 79 82 81 62 73 75
> 
> > ascii_str2 <- "FDC"
> 70 68 67

You might have a look at Henrik Bengtsson's charToInt in R.oo. And peek at the
code with some nice caveats from Peter Dalgaard and Brian Ripley.

Dieter



More information about the R-help mailing list