Re: [R] Class noquote to matrix

From: Peter Ehlers <ehlers_at_ucalgary.ca>
Date: Wed, 30 Mar 2011 02:04:06 -0700

On 2011-03-29 19:12, Mark Ebbert wrote:
> Hi,
>
> I apologize if the solution is right in front of me, but I can't find anything on how to convert a class of 'noquote' to 'matrix'. I've tried as.matrix and I've tried coercing it by 'class(x)<-matrix', but of course that didn't work. I've been using the function 'symnum' which returns an object of class 'noquote'.
>
> Here is an example from the 'symnum' help page:
> pval<- rev(sort(c(outer(1:6, 10^-(1:3)))))
> symp<- symnum(pval, corr=FALSE,
> cutpoints = c(0, .001,.01,.05, .1, 1),
> symbols = c("***","**","*","."," "))

One way would be to unclass the object first:

  as.matrix(unclass(symp))

Peter Ehlers

>
> Thanks!
> ______________________________________________
> R-help_at_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.



R-help_at_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. Received on Wed 30 Mar 2011 - 09:13:02 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 30 Mar 2011 - 19:50:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive