Learn R Programming

pinyin (version 1.1.0)

pinyin: Convert Chinese characters into Pinyin.

Description

Convert Chinese characters into Pinyin.

Usage

pinyin(mychar = "", method = c("quanpin", "tone", "toneless"), sep = "_", 
    nonezh_replace = NULL, multi = FALSE, only_first_letter = FALSE)

Arguments

mychar

character. A Chinese character or string to convert to pinyin

method

character. The value can be:

  • 'quanpin', for the standard form of pinyin (tones above letters),

  • 'tone', for tones expressed with numbers,

  • 'toneless', without tones

sep

character. Seperation between the converted pinyin.

nonezh_replace

NULL or character. Define how to convert non-Chinese characters in mychar. NULL means 'let it be'.

multi

logical. Whether display multiple pronounciations of a Chinese character or only the first pronounciation.

only_first_letter

logical. Wheter only the first letter in pinyin.

Value

pinyin of the given Chinese character.

Examples

Run this code
# NOT RUN {
pinyin()
# }

Run the code above in your browser using DataLab