Reputation: 8254
How do I convert from "character"
to "raw"
?
class ( plot_binary )
# [1] "raw"
plot_binary[3]
# [1] 4e
class ( plot_binary[3] )
# [1] "raw"
I want to do a conversion from a character "4e"
to a raw 4e
.
How do I do this?
as.raw
obviously not work because
as.raw("4e")
# [1] 04
Upvotes: 3
Views: 2640
Reputation: 11
R accepts hexadecimal numeric input prefixed with 0x
.
> as.raw(0x4e)
[1] 4e
Upvotes: 1