[R] ASCII characters: from decimal code to R octal?

David Firth david.firth at nuffield.oxford.ac.uk
Mon Feb 4 11:35:02 CET 2002


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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list