This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ==== Creating UTF-8 strings ==== | |
# This is how to create a string with UTF-8 encoding. This should work | |
# regardless of the current locale settings. | |
x <- rawToChar(as.raw(c(0xe5, 0x8d, 0x88))) | |
Encoding(x) <- "UTF-8" | |
x | |
# [1] "午" | |
# Another string, 'Δ★😎' | |
pat <- rawToChar(as.raw(c(0xce, 0x94, 0xe2, 0x98, 0x85, 0xf0, 0x9f, 0x98, 0x8e))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shim_system_file <- function(package) { | |
imports <- parent.env(asNamespace(package)) | |
pkgload:::unlock_environment(imports) | |
imports$system.file <- pkgload:::shim_system.file | |
} | |
shim_system_file("htmlwidgets") | |
shim_system_file("htmltools") | |
# After the code above has been run, you can load an in-development package |