[R] How to change the class of data?

Charilaos Skiadas cskiadas at gmail.com
Thu Jun 12 08:59:29 CEST 2008


On Jun 12, 2008, at 2:24 AM, Qman Fin wrote:

> Hi all,
>
> I have some data x, which are actualy consisted of numerical  
> enties. But the
> class of this matrix is set to be "factor" by someone else. I used
> "class(x)", it turns out to be "factor". So I can not calculate them.
>
The typical approach is to do:

as.numeric(as.character(x))

> How can I turn them into numerical data so that I can apply math  
> operations
> on them? Thanks a lot for your help.
>
> Selina

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College



More information about the R-help mailing list