Skip to content
Back to formatted view

Raw Message

Message-ID: <OF62004854.0769B547-ON88256E3D.005A4327-88256E3D.005AC73A@epamail.epa.gov>
Date: 2004-02-17T16:31:33Z
From: White.Denis@epamail.epa.gov
Subject: column names in matrix vs. data frame in R 1.8

...

> > Ok, I'll regard it as an inconsistency that the conversion of
dimnames
> > to data frame column names changes reserved words to legitimate
names
> > but direct assignment doesn't.
>
> It's not inconsistent.  data.frame has an argument `check.names' to
> control the behaviour on *creating* a data frame, and you didn't
consult
> the documentation.  Using the function names<- on the list underlying
the
> data frame does not know or care it is applied to a data frame.

After thinking about this, I guess I wonder why names<- shouldn't have
the argument 'check.names' and/or check the class of its main argument.
Why offer protection in one situation and not another?