Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何从 转换"character"为"raw"?
"character"
"raw"
class ( plot_binary ) # [1] "raw" plot_binary[3] # [1] 4e class ( plot_binary[3] ) # [1] "raw"
我想做从字符"4e"到原始的转换4e。
"4e"
4e
我该怎么做呢?
as.raw显然不起作用,因为
as.raw
as.raw("4e") # [1] 04
找到了解决方案:
as.raw ( as.hexmode ( "4e" ) ) #[1] 4e
尝试查看:rawToChar和charToRaw
rawToChar
charToRaw