Skip to content
Back to formatted view

Raw Message

Message-ID: <73f827b50812220030q636801f3sc8385a2e49661b4f@mail.gmail.com>
Date: 2008-12-22T08:30:27Z
From: Gundala Viswanath
Subject: Convert ASCII string to Hex in R (vice versa)
In-Reply-To: <loom.20081222T074125-498@post.gmane.org>

Dear all,


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.

Please advice.

- Gundala Viswanath
Jakarta - Indonesia



On Mon, Dec 22, 2008 at 4:44 PM, Dieter Menne
<dieter.menne at menne-biomed.de> wrote:
> Gundala Viswanath <gundalav <at> gmail.com> writes:
>
>> Is there such a package in R?
>
> Re: Convert ASCII string to Hex in R (vice versa)
>
> Difficult to understand what you want: could be
>
> x = 32
> (b = sprintf("%x",x) )
>
> Also check hexmode/as.hexmode
>
> Dieter
>
> ______________________________________________
> R-help at r-project.org 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.
>