Skip to content
Back to formatted view

Raw Message

Message-ID: <a05010408b88410ae2303@[163.1.41.88]>
Date: 2002-02-04T10:35:02Z
From: David Firth
Subject: ASCII characters: from decimal code to R octal?

Is there a straightforward way to convert character information from 
decimal representation to the octal one used by R?

I'd like something like a function ascii(number,base=10), such that

>  ascii(91)
[1] "\133"

I can easily do the mapping from 91 to 133, but what is a good way to 
operate on  133 to deliver "\133"?

Would a lookup table be a better solution?

David
-- 


David Firth                        Phone +44 1865 278544
Nuffield College                   Fax   +44 1865 278621
Oxford OX1 1NF                     Secretary +44 1865 278553
United Kingdom                     Email david.firth at nuffield.ox.ac.uk

http://www.stats.ox.ac.uk/~firth/
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._