Learn R Programming

Nippon (version 0.2.2)

kakasi: Interface to kakasi

Description

The kakasi is an interface to the external program kakasi, KAnji KAna Simple Inverter. It is useful especially when Japanese Kanji characters are subject to convert to Romaji (ASCII) characters.

Usage

kakasi(x, kakasi.option="-Ha -Ka -Ja -Ea -ka", invisible=TRUE)

Arguments

x
A character vector
kakasi.option
Options passed to kakasi program
invisible
Under Windows, do not open an extra window

Value

  • A character vector

Details

Japanese strings are often made up a mixture of Chinese characters (Kanji), Kana (Hiragana and Katakana) and Romaji (Latin phonetical pronunciation). The external program kakasi converts between these four different ways of writing Japanese. The function wraps the external program kakasi with system(). The kakasi program must be present and on the user's PATH for the function to work. kakasi is useful especially for sanitizing a character vector by converting Japanese (non-ASCII) to ASCII characters.

References

KAKASI - Kanji Kana Simple Inverter http://kakasi.namazu.org/

Examples

Run this code
library(Nippon)
data(prefectures)
regions <- unique(prefectures$region)
regions
kakasi(regions)

Run the code above in your browser using DataLab