Re: [R] Suppressing observation numbers

From: Rolf Turner <rolf_at_math.unb.ca>
Date: Thu 03 Mar 2005 - 09:30:21 EST

Nam-Ky Nguyen wrote:

> Below is a part of the R output. Please consider the two lines:
> > data
> > model.matrix(m1)
>
> Is there a way of suppressing the observation numbers 1, 2, ...27 in the
> output (I don't want these number to appear in the output)?

The (``relatively low level''?) function prmatrix() allows you to do what you want:

        > prmatrix(model.matrix(m1),rowlab=rep("",27))

I have in the past suggested to the R Core Team that an argument be added to print.matrix() and print.data.frame() to permit the suppression of the printing of row names. Something like ``print.row.names=TRUE''. This would be easy to accomplish, since print.matrix() and print.data.frame() simply call upon prmatrix(). However my suggestion has so far fallen upon deaf ears.

                                cheers,

					Rolf Turner
					rolf@math.unb.ca

______________________________________________
R-help@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 Received on Thu Mar 03 09:58:41 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:39 EST