Created
March 31, 2026 14:48
-
-
Save jmclawson/e507ef52a787d298e6de2980953cb1b2 to your computer and use it in GitHub Desktop.
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
| # Convert UTF-8 characters to other encodings: | |
| ## A special character (e.g., in an Excel file) | |
| ## might mess up later steps, so we may want to | |
| ## use Unicode or ASCII encodings. | |
| ## Example: | |
| ### ≥ depicted as ">=" or "U+2265" | |
| my_string <- "Check whether x ≥ 4" | |
| my_string |> | |
| iconv(to = "ASCII//TRANSLIT") | |
| # [1] "Check whether x >= 4" | |
| my_string |> | |
| iconv(to = "ASCII", | |
| sub = "Unicode") | |
| # [1] "Check whether x <U+2265> 4" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment