Re: [R] Converting english words to numeric equivalents

From: baptiste auguie <>
Date: Mon, 28 Jul 2008 10:29:22 +0100

Here is my attempt at this (taking a specific understanding of the ill- defined "equivalence" relation),

unletter <- function(word){         

	word.broken <- strsplit(word, NULL)
	set.of.numbers <- sapply(word.broken[[1]], function(let) which(let ==  
	paste(set.of.numbers, sep="", collapse="")

# "123"

# "242526"

# "191122120"

>>> Hello,
>>> I am trying to convert english words to numeric equivalents, e.g.,
>>> abc to
>>> 123. Is there a function or library or package for doing this in
>>> R? If not,
>>> can it be done easily in R?

Baptiste Auguié

School of Physics
University of Exeter
Stocker Road,
Exeter, Devon,

Phone: +44 1392 264187 mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon 28 Jul 2008 - 09:32:21 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 28 Jul 2008 - 10:32:31 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive