[R] a class matrix with class ordered data

Spencer Graves spencer.graves at pdf.com
Thu Jul 28 06:24:16 CEST 2005


	  If you still are interested in help with your problem, PLEASE do read 
the posting guide! http://www.R-project.org/posting-guide.html.  It can 
increase the likelihood of you getting a useful reply.

	  See other comments in line.

	  spencer graves

Werner Bier wrote:
> Deart R-help,
> 
> I could not transfer ordered data into a matrix, does anybody knows if there is something wrong in the code below please?
> 
> Thanks in advance, Tom
> 
> Y <- ordered( unlist( Q[,1:2] ) )

	  This creates Y as an ordered factor.
> 
> z <- matrix(0, nrow(Q), 2)
> 
> z <- Y
> 
	  This completely discards the matrix z and replaces it with Y. 
Nothing of the matrix remains (except in your memory).

> is.ordered(z)
> 
> [1] T
> 
> is.matrix(z)
> 
> [1] F
> 
> i.e. Is it possibile somehow to have is.matrix(z) equal TRUE?
> 
	  Rather than asking only for an explanation of some little thing that 
didn't solve your problem, may I suggest you tell us more about the 
problem you are actually trying to solve.  Why are you doing this?  What 
specifically do you want to accomplish -- but expressed in terms of a 
very simple example with a few lines of code that a reader can copy into 
R on their computer and get something, then try a couple of 
modifications that might be closer to what you want.
>  
> 
> 
> __________________________________________________
> 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> 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

-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

spencer.graves at pdf.com
www.pdf.com <http://www.pdf.com>
Tel:  408-938-4420
Fax: 408-280-7915




More information about the R-help mailing list