[R] Converting to unsigned char
Peter Dalgaard
p.dalgaard at biostat.ku.dk
Wed Sep 3 23:47:17 CEST 2008
Hutchinson,David [PYR] wrote:
> Is there a way to convert a character (such as "m") to a value between 0
> and 255?
>
> as.numeric(charToRaw("m"))
[1] 109
Watch out with non-ascii characters though.
>
> Thanks in advance,
> Dave
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>
--
O__ ---- Peter Dalgaard Øster Farimagsgade 5, Entr.B
c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
More information about the R-help
mailing list