Created
May 17, 2017 03:55
-
-
Save nozma/8a9c29a1d5452084b1e24cf8aa5eb781 to your computer and use it in GitHub Desktop.
RからExcelで文字化けしないCSVを出力する ref: http://qiita.com/nozma/items/6de3e636d175cc3d6e3f
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
| df <- data.frame(a = letters[1:3], | |
| b = c("あ", "い", "う")) |
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
| write.csv(df, "test.csv") |
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
| write.csv(df, "test.csv", fileEncoding = "CP932") |
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
| read.csv("test.csv", fileEncoding = "CP932") |
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
| readr::read_csv("test.csv", locale=readr::locale(encoding="CP932")) |
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
| readr::write_excel_csv(df, "test.csv") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment