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

Dieter Menne dieter.menne at menne-biomed.de
Mon Dec 22 09:49:26 CET 2008


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

> For example I have the following ASCII strings:
> 
> > ascii_str  <- "ORRRIROOQRQQOLORRRRRRQRROKK>IKFAA"
> > ascii_str2 <- "FFFFFFFFFFDDDDDDDDDDCCCCC>>>>>>>>>"
> 
> Each character in the above string represent a hexadecimal value.
> I want to translate those string into an array (of size == string length)
> which contain hexadecimal conversion.
> 
> as.hexmode doesn't seem to do the job.

Trying again, simplified

ascii_str  <- "ORQ>IK"
ascii_str2 <- "FDC"

What do you want as output in both cases? I can partially understand the second
case, but not the first.

Dieter



More information about the R-help mailing list