Re: [R] Chars as numbers

From: Tobias Muhlhofer <t.muhlhofer_at_lse.ac.uk>
Date: Sat 28 May 2005 - 00:28:15 EST

Josef,

Not sure if this is exactly what you mean, but there is a generic function

as()

to which you can then specify "numeric" as an argument and which then coerces stuff into numeric format.

Tobias

Josef Eschgfaeller wrote:
>
> Is there a proper function for transforming
> a character to a number instead of using
>
> i=match('c',letters)
> # 3
>
> Thanks.
> Josef Eschgfäller
>
>
> ------------------------------------------------------------------------
>
> ______________________________________________
> 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

-- 
**************************************************************************
When Thomas Edison invented the light bulb he tried over 2000
experiments before he got it to work. A young reporter asked
him how it felt to have failed so many times. He said
"I never failed once. I invented the light bulb.
It just happened to be a 2000-step process."

______________________________________________
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 Sat May 28 00:43:59 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:11 EST