Skip to content

Instantly share code, notes, and snippets.

@jmbarbone
Created September 4, 2021 15:50
Show Gist options
  • Save jmbarbone/b1d0c1535e20c7555b1b890530d8eeda to your computer and use it in GitHub Desktop.
Save jmbarbone/b1d0c1535e20c7555b1b890530d8eeda to your computer and use it in GitHub Desktop.
Playing with character and raw values
# Char to Raw to Character
charToRaw("Jordan") |>
as.character() |>
as.hexmode() |>
as.raw() |>
rawToChar()
# Tricks |>
brackets <- `[[`
"4a 6f 72 64 61 6e" |>
strsplit(" ") |>
brackets(1) |>
as.hexmode() |>
as.raw() |>
# Sometimes better
rawToChar(multiple = TRUE) |>
paste(collapse = "")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment