numberize #92
Replies: 3 comments 5 replies
-
Looks good @bahadzie - I think numberize is a good name, but you might want someone with more imagination to weigh in. Just commenting on the side issue - some markdown formatting does work in titles, such as monospace formatting, but haven't seen it work for italics. Also a perhaps silly question - what's the limiting factor on the upper limit of the number that can be converted from text to digits? As in, what's the technical limit preventing conversion of, say, "one quadrillion", "one googol"? Not saying you should add these, just curious where R decides enough is enough. |
Beta Was this translation helpful? Give feedback.
-
Looks great @bahadzie ! - Very useful for interoperability of epidemiological reports and line lists among countries. About package name I think that regarding the one you choose, @bbah74 's {str2num} is a great name for the main function. It feels very coherent with other packages usages. An observation I want to make (not sure if you are aware) is to be careful between "billion" concept in Spanish and English: Billion [EN] = A thousand million = 1,000,000,000 As well as numbers variations (ex. "veintiuno" and "veintiún" in Spanish for 21). Just let us know how we can help to document these and other false-friends and variations among English, French and Spanish. |
Beta Was this translation helpful? Give feedback.
-
Hi @bahadzie and others I just managed to solve my login issues with github, the 2FA is a pain :(. Very good comments from @pratikunterwegs and @juan-umana. Just to quickly point out that {str2num} is also used in Matlab, be due diligent to make sure they don't sue us as they are proprietary software. |
Beta Was this translation helpful? Give feedback.
-
numberize is an R package to convert numbers written as English, French or Spanish words from
"zero"
to"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"
from a character string to a numeric value.The idea arose from discussions around {cleanepi} and how messy data could potentially have numbers written in words which would need converting to a numeric datatype for downstream analysis.
I have implemented an experimental package on https://github.com/bahadzie/numberize
This gave me an opportunity to test our packagetemplate repo
@Bisaloo I will be posting some feedback on using it to build a package. Are Issues an acceptable way to do this?
Suggestions for a better package name are open. Submissions so far are {numberwise @adamkucharski}, {text2num @nuredinibrahim}, {str2num @bbah74}. If they're wrong, that is my mishearing. Please correct me.
PS. Is there a way to italicize Discussion Title or does markdown only apply to the body.
Beta Was this translation helpful? Give feedback.
All reactions