From Kurt.Hornik@ci.tuwien.ac.at  Wed Feb  7 15:45:58 2001
From: Kurt.Hornik@ci.tuwien.ac.at (Kurt Hornik)
Date: Wed, 7 Feb 2001 16:45:58 +0100
Subject: [Rd] RE: [R] Removing "row.names"
In-Reply-To: <NEBBJKDJHEFCOOLFFAKKIEMFCAAA.cyg@sympatico.ca>
References: <200102071105.LAA08910@achill.nmrc.ucc.ie>
 <NEBBJKDJHEFCOOLFFAKKIEMFCAAA.cyg@sympatico.ca>
Message-ID: <14977.28086.8858.910911@mithrandir.hornik.net>

>>>>> Yves Gauvreau writes:

> Try this
> sampled <- data.frame(sample(rnorm(100),2))
> colnames(sampled) <- " " # Or preferably something meaningful
> sampled

> 1 1.777068
> 2 0.937161

Ouch!

This *surely* is a bug.  How can it be possible to remove the variable
names in a data frame?

It may be time to reconsider what
	rownames
	colnames
	case.names
	variable.names
do for data frames.

But in fact, both

	names(sampled) <- " "
and
	dimnames(sampled)[[2]] <- " "

happily introduce non-unique variable names in the data frame.

Is the rule that row.names and names must be unique still on?

Argh ...

-k
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] RE: [R] Removing "row.names"
Kurt Hornik