Hi Selina,
try ?as.numeric,

 small example
 a=c(1,2,3,4,5)
 b=as.factor(a)
class(b)

c=as.numeric(b)
class(c)

in the case of a matrix of factor,try 
apply(matrix,1, as.numeric)
 
Cheers

A.


----- Messaggio originale -----
Da: Qman Fin <finosaur@gmail.com>
A: r-help@r-project.org
Inviato: Giovedì 12 giugno 2008, 8:24:08
Oggetto: [R] How to change the class of data?

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.

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

Selina

    [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



      ___________________________________ 

pinione!
http://www.ymailblogit.com/blog/
	[[alternative HTML version deleted]]

