[R] Change the mode of a list

Felix Wave felix-wave at vr-web.de
Fri Apr 20 13:17:28 CEST 2007

can anybody tell me a easy way to change the mode of an "aggregate list" to "numeric"?
I found a solution but I looks cruel. 


PS: In the past you have asked what I am doing. I have to evaluate measures of two
gauges of our university. The aim is to get an answer which one is better.

> mode(MEAN)
[1] "list" 
> mode(MEASURE)
[1] "numeric"

MEAN    <- aggregate(INPUT[,3], by=list(INPUT[,2],INPUT[,1]), FUN=mean)

MODE <- matrix(c(MEAN[,2],MEAN[,1],MEAN[,3]), ncol=3, byrow=FALSE )
x <-  MODE[,1] -1
y <- (MODE[,2] -1) / 10

MEASURE <- matrix(c(MODE[,2],MODE[,1],MODE[,3]), ncol=3, byrow=FALSE )

More information about the R-help mailing list