Re: [S] how to remove the display of row-numbers of a data.frame

Alan Zaslavsky (
Thu, 2 Apr 1998 07:07:00 -0500 (EST)

> From: Ming Ji <>
> ... Usually, if you type the name of a
> data.frame, say, xxx.df, then its content will be printed on the screen,
> together with the row-numbers. ...
> My question is: is there a way to hide this numbering of the rows of
> xxx.df ...

There is a trick for this for ordinary matrices, which is to assign empty
character data to the row names. You can't do this directly with data frames
because data frames are checked for unique row names. If you look at the
code for you will see that the work is done by the following

print(as.matrix(x), ..., quote = quote, right = right)

so if you have a data.frame X, you can print without row names as follows:

print(as.matrix(Xmat), quote = F, right = T)

Giving, for example, the following output:

a b cc
1 11 a
2 12 b
3 13 c

This message was distributed by To unsubscribe
send e-mail to with the BODY of the
message: unsubscribe s-news