Learn R Programming

pinyin (version 1.1.2)

bookdown2py: Convert the Chinese headers of bookdown .Rmd files into Pinyin

Description

Convert the Chinese headers of bookdown .Rmd files into Pinyin

Usage

bookdown2py(folder = "py", remove_curly_bracket = TRUE, nonezh_replace = NULL, 
    only_first_letter = TRUE)

Arguments

folder

character. The folder in which the files are to be converted.

remove_curly_bracket

logical. Whether to remove existing curly brackets in the headers.

nonezh_replace

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

only_first_letter

logical. Wheter only the first letter in pinyin.

Value

new .Rmd files with Pinyin headers.

Examples

Run this code
# NOT RUN {
mydir <- paste0(tempdir(), "/py")
dir.create(mydir)
file.create(paste0(mydir, "/test.txt"))
writeLines(text = "# test\n", paste0(mydir, "/test.txt"))
bookdown2py(mydir)
# }

Run the code above in your browser using DataLab