Re: [R] R function to convert a number to text

2008-03-04 Thread lin tang
" To: "lin tang" Cc: Sent: Monday, March 03, 2008 11:38 AM Subject: Re: [R] R function to convert a number to text > lin tang wrote: >> hi, Dear R users - >> >> I wonder is there a written R function to convert a number to a >> text, say convert 1 to

Re: [R] R function to convert a number to text

2008-03-04 Thread Jim Lemon
Alberto Monteiro wrote: > ... > Be careful, the function does not handle "empty" fields: Okay, Alberto, you asked for it! digits2text<-function(x,illion=0) { units<-c("one","two","three","four","five", "six","seven","eight","nine") teens<-c("ten","eleven","twelve","thirteen","fourteen",

Re: [R] R function to convert a number to text

2008-03-03 Thread Gabor Grothendieck
Try RSiteSearch("numbers2words") On Sun, Mar 2, 2008 at 9:05 PM, lin tang <[EMAIL PROTECTED]> wrote: > hi, Dear R users - > > I wonder is there a written R function to convert a number to a text, say > convert 1 to "one" , 100 to "one hundred". I know in xls. has such a > function BAHTTEXT, d

Re: [R] R function to convert a number to text

2008-03-03 Thread Dimitris Rizopoulos
Sent: Monday, March 03, 2008 11:38 AM Subject: Re: [R] R function to convert a number to text > lin tang wrote: >> hi, Dear R users - >> >> I wonder is there a written R function to convert a number to a >> text, say convert 1 to "one" , 100 to "one

Re: [R] R function to convert a number to text

2008-03-03 Thread Alberto Monteiro
Jim Lemon wrote: > > I got bored after the millions, but this should handle the smaller > numbers, and you can always extend it. > > digits2text<-function(x,mult="") { > units<-c("one","two","three","four","five", >"six","seven","eight","nine") > teens<-c("ten","eleven","twelve","thirtee

Re: [R] R function to convert a number to text

2008-03-03 Thread Jim Lemon
lin tang wrote: > hi, Dear R users - > > I wonder is there a written R function to convert a number to a text, say > convert 1 to "one" , 100 to "one hundred". I know in xls. has such a > function BAHTTEXT, does anybody know is there a similar function in R ? > Thanks. > Hi Lin, I got bored a

[R] R function to convert a number to text

2008-03-02 Thread lin tang
hi, Dear R users - I wonder is there a written R function to convert a number to a text, say convert 1 to "one" , 100 to "one hundred". I know in xls. has such a function BAHTTEXT, does anybody know is there a similar function in R ? Thanks. Lin -