I am trying to use pamr (prediction analysis of microarray), which uses nearest shrunken centroid classification. Now I want to load my data using read.table, then use pamr. the codes are as follows:

Training = read.table("A.txt",header = FALSE)
myData = list(x = Training,y = factor(TrainingLabel));
mytrain = pamr.train(myData)
It always complains "Error in x %*% Y : requires numeric matrix/vector arguments"

I think the main reason is variable Training read from read.table is an object, not just numeric matrix, I tried as.numeric(Training), it still has errors. I know if Training is created by something like 

Training = matrix(rnorm(1000*20),ncol=20) 
It will not complain, since by this way, Training is purely a numeric matrix, not object. Does anybody know how to convert the object read from read.table to a pure numeric matrix?

Thanks,

James


 
---------------------------------

	[[alternative HTML version deleted]]

