numberize
v1.0.1
numberize是一个 R 包,用于将英语、法语或西班牙语单词书写的数字从"zero"
转换为"nine hundred and ninety nine trillion, nine hundred and ninety nine billion, nine hundred and ninety nine million, nine hundred and ninety nine thousand, nine hundred and ninety nine"
为正整数值。
numberize是伦敦卫生与热带医学学院传染病数学建模中心开发的,作为 Epiverse-TRACE 计划的一部分。
可以使用以下命令从 CRAN 安装该软件包
install.packages( " numberize " )
您可以使用以下命令从 GitHub 安装numberize的开发版本:
pak :: pak( " epiverse-trace/numberize " )
这些示例说明了当前的功能。
library( " numberize " )
# numberize a French string
numberize( " zéro " , lang = " fr " )
# > [1] 0
# numberize a Spanish string
numberize( " Siete mil quinientos cuarenta y cinco " , lang = " es " )
# > [1] 7545
# numberize the English string "nine hundred and ninety-nine trillion, nine hundred and ninety-nine billion, nine hundred and ninety-nine million, nine hundred and ninety-nine thousand, nine hundred and ninety-nine" # nolint: line_length_linter.
formatC(numberize( " nine hundred and ninety-nine trillion, nine hundred and ninety-nine billion, nine hundred and ninety-nine million, nine hundred and ninety-nine thousand, nine hundred and ninety-nine " ), big.mark = " , " , format = " fg " ) # nolint: line_length_linter.
# > [1] "999,999,999,999,999"
# some edge cases
numberize( " veintiún " , lang = " es " )
# > [1] 21
numberize( " veintiuno " , lang = " es " )
# > [1] 21
# convert a vector of written values
numberize(
text = c( 17 , " dix " , " soixante-cinq " , " deux mille vingt-quatre " , NA ),
lang = " fr "
)
# > [1] 17 10 65 2024 NA
{numberwang}
将数字转换为单词,反之亦然。限制:仅限英文,不适用于 CRAN。{nombre}
将数字转换为单词。限制:仅限英文,没有单词到数字的转换。{english}
将数字转换为单词。限制:仅限英文,没有单词到数字的转换。{spanish}
将数字转换为单词,反之亦然。限制:仅限西班牙语。numberize作为独立包发布,希望它对整个 R 社区有用。 numberize是为了响应 {cleanepi} 中的数据清理要求而创建的。
根据 RECON 软件生命周期的定义,该软件包目前是稳定的。
欢迎通过拉取请求做出贡献。
请注意, numberize项目是随贡献者行为准则一起发布的。通过为该项目做出贡献,您同意遵守其条款。