dat <-
read.table(file = "data/melos.txt",
fileEncoding = "shift-jis",
header = FALSE,
stringsAsFactors = FALSE))
⽇本語データの読み込み
エンコーディング
UTF-8
Shift-JIS JIS X 0208
Unicode
Character
Windows
Mac, Linux
⽂字 ⽂字コード
Slide 13
Slide 13 text
dat <-
read.table(file = "data/melos.txt",
fileEncoding = "shift-jis",
header = FALSE,
stringsAsFactors = FALSE))
⽇本語データの読み込み
> dat %>% as_tibble()
# A tibble: 77 x 1
V1
1 ⾛れメロス
2 太宰治
3 メロスは激怒した。必ず、かの邪智暴虐の王を除かな…
4 「王様は、⼈を殺します。」
5 「なぜ殺すのだ。」
dat <- mecab_result %>%
purrr::map_dfr(
~ data.frame(
term = .,
class = names(.))
) %>%
tidyr::as_tibble()
データの整形
# A tibble: 6,432 x 2
term class
1 ⾛れ 動詞
2 メロス 名詞
3 太宰 名詞