I am trying to handle Latin Small Letter O with Circumflex in R?
library(tibble)
library(dplyr)
sessionInfo()
R version 4.2.0 (2022-04-22 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.utf8
[2] LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8
attached base packages:
[1] stats graphics grDevices datasets utils methods base
other attached packages:
[1] dplyr_1.0.8 tibble_3.1.6 stringr_1.4.0 rstudioapi_0.13
[5] startup_0.17.0
loaded via a namespace (and not attached):
[1] cellranger_1.1.0 pillar_1.7.0 compiler_4.2.0
[4] sysfonts_0.8.8 base64enc_0.1-3 tools_4.2.0
[7] extrafont_0.18 digest_0.6.29 googledrive_2.0.0
[10] evaluate_0.15 lifecycle_1.0.1 gargle_1.2.0
[13] pkgconfig_2.0.3 rlang_1.0.2 cli_3.3.0
[16] DBI_1.1.2 yaml_2.3.5 xfun_0.30
[19] fastmap_1.1.0 Rttf2pt1_1.3.10 comtradr_0.3.0
[22] gmailr_1.0.1 httr_1.4.2 knitr_1.38
[25] generics_0.1.2 vctrs_0.4.1 fs_1.5.2
[28] tidyselect_1.1.2 glue_1.6.2 R6_2.5.1
[31] fansi_1.0.3 readxl_1.4.0 rmarkdown_2.14
[34] extrafontdb_1.0 rdrop2_0.8.2.1 purrr_0.3.4
[37] magrittr_2.0.3 ellipsis_0.3.2 htmltools_0.5.2
[40] assertthat_0.2.1 utf8_1.2.2 stringi_1.7.6
[43] crayon_1.5.1
df <- tibble(economy = c("Afghanistan", "Albania", "C\xf4te d'Ivoire")) %>%
arrange(economy)
write.csv(df, "test1.csv", fileEncoding = "latin1")
df <- tibble(economy = c("Afghanistan", "Albania", "C\uf4te d'Ivoire")) %>%
arrange(economy)
write.csv(df, "test2.csv", fileEncoding = "UTF-8")