[R] Change the mode of a list
jholtman at gmail.com
Fri Apr 20 13:33:42 CEST 2007
This will take all the numerics in the list and create a matrix:
On 4/20/07, Soare Marcian-Alin <soarealin at gmail.com> wrote:
> I dont know if it works, but try: storage.mode(xxx) = "numeric"
> 2007/4/20, Felix Wave <felix-wave at vr-web.de>:
> > Hello,
> > 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.
> > Thank's
> > Felix
> > 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)
> >  "list"
> > > mode(MEASURE)
> >  "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 )
> > ______________________________________________
> > R-help at 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
> > and provide commented, minimal, self-contained, reproducible code.
> [[alternative HTML version deleted]]
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
+1 513 646 9390
What is the problem you are trying to solve?
More information about the R-help