From hpages at fhcrc.org  Tue May 15 08:59:28 2007
From: hpages at fhcrc.org (Herve Pages)
Date: Mon, 14 May 2007 23:59:28 -0700
Subject: [Rd] Unexpected alteration of data frame column names
Message-ID: <46495A50.6050701@fhcrc.org>

Hi,

I'm using data.frame(..., check.names=FALSE), because I want to create
a data frame with duplicated column names (in the real life you can get such
data frame as the result of an SQL query):

  > df <- data.frame(aa=1:5, aa=9:5, check.names=FALSE)
  > df
    aa aa
  1  1  9
  2  2  8
  3  3  7
  4  4  6
  5  5  5

Why is [.data.frame changing my column names?

  > df[1:3, ]
    aa aa.1
  1  1    9
  2  2    8
  3  3    7

How can this be avoided? Thanks!

H.



[Rd] Unexpected alteration of data frame column names
Herve Pages