[topic] 文字コードの変換
Posted feedbacks - R
シンプルに。
1 2 3 4 5 6 7 8 9 10 11 12 13 | #1. convert encoding of string from sjis to eucjp
sjis2euc.character <- function(str){
iconv(str, "sjis", "eucjp")
}
#2. convert encoding of file from sjis to eucjp
sjis2euc.file <- function(infile="sample.sjis", outfile="sample.eucjp"){
fr <- file(infile, "r", encoding="sjis")
fw <- file(outfile, "w", encoding="eucjp")
cat(readLines(fr), sep="\n", file=fw)
close(fr)
close(fw)
}
|


ところてん
#4620()
Rating1/1=1.00
[ reply ]