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

Alan Zaslavsky (zaslavsk@hcp.med.harvard.edu)
Thu, 2 Apr 1998 17:44:22 -0500 (EST)


> From: "Patrick Connolly" <PConnolly@grunt.marc.cri.nz>
> What I meant was as.data.frame(Xmat) works fine with no quotes on the
> character columns. For some reason, the data frame is not checked to
> see if the row names are unique. I call that a feature, so I'd hate
> to see it fixed.

In a sense it is a bug, but got by because the checking of attributes is
not entirely consistently implemented in S version 3. S version 4
(not S-Plus 4.0, but the new version of S being developed now) has much
stronger checking features (the required components of an object in a given
class are described in a database and checked automatically) so this
is less likely to get by. In the meantime, that's a handy trick.

There is actually an argument "optional" to as.data.frame which
determines whether row names are created (default is F). I suspect
that the reason for this is that as.data.frame is primarily intended
to be called by data.frame() to convert arguments to data.frame(), of
many different varieties, into data frames that can be stuck
together. Each of the pieces doesn't need row.names since
data.frame() makes sure that once it is all put together the
resulting data frame gets row names.
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news