Re: [R] How to create a vector with "one", "two", "three", ...?

From: Marc Schwartz <MSchwartz_at_medanalytics.com>
Date: Sun 17 Apr 2005 - 08:24:05 EST

I may be wrong, but I am unaware of anyone that has created a number to text function in R.

If you search Google:

http://www.google.com/search?q=numbers+into+words

There are various program examples, from VB to JavaScript to PHP, etc.

It shouldn't be too hard to convert one of them to R. Most have fairly common constructs in terms of parsing and converting the numbers. Some of them handle decimals and currency formats as well.

HTH, Marc Schwartz

On Sat, 2005-04-16 at 18:01 -0400, Frank Duan wrote:
> Sorry, I didn't get the question clear. What I meant is to create a
> character vector with length 200:
> "one", "two", "three", ..., "two hundred"
>
> On 4/15/05, Federico Calboli <f.calboli@imperial.ac.uk> wrote:
> > On Fri, 2005-04-15 at 14:30 -0400, Frank Duan wrote:
> > > Hi R people,
> > >
> > > I met a naive prolem. Could anyone give me a hint how to create such a
> > > vector with entries: "one", "two", "three", ...?
> >
> > rvect <- c("one", "two", "three")
> > rvect
> > [1] "one" "two" "three"
> >
> > Is it what you want?
> >
> > F



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sun Apr 17 08:32:38 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:13 EST