【发布时间】:2020-03-25 14:29:20
【问题描述】:
我有一个单列数据框,其中每一行都是一个语句。这些语句大多是字母字符,但也有一些数字字符。我正在尝试找到所有数字字符并将它们替换为相应的字母字符。
基本上,我想从这里开始
"I looked at the watermelons around 12 today"
"There is a dog on the bench"
"the year is 2017"
"I am not hungry"
"He turned 1 today"
进入(或类似的东西)
"I looked at the watermelons around twelve today"
"There is a dog on the bench"
"the year is two thousand seventeen"
"I am not hungry"
"He turned one today"
有一些我熟悉的函数可以将数字转换为单词,例如 xfun 包中的 numbers_to_words 函数,但我不知道如何系统地为整个数据框执行此操作。
【问题讨论】:
-
但是在这种情况下你如何应用它呢?
标签: r string int alphanumeric