From fgnu32 at yahoo.com  Tue Jul 23 18:54:13 2013
From: fgnu32 at yahoo.com (Fg Nu)
Date: Tue, 23 Jul 2013 09:54:13 -0700 (PDT)
Subject: [Rd] cbind error with check.names
In-Reply-To: <CA+vqiLGkncU6QZm0CqBs+PbbXzFuGnzWvOOfrVqN9mUc4kttpQ@mail.gmail.com>
References: <1374585525.97733.YahooMailNeo@web160105.mail.bf1.yahoo.com>
	<CA+vqiLGkncU6QZm0CqBs+PbbXzFuGnzWvOOfrVqN9mUc4kttpQ@mail.gmail.com>
Message-ID: <1374598453.74044.YahooMailNeo@web160105.mail.bf1.yahoo.com>




----- Original Message -----
From: Ista Zahn <istazahn at gmail.com>
To: Fg Nu <fgnu32 at yahoo.com>
Cc: "r-devel at r-project.org" <r-devel at r-project.org>
Sent: Tuesday, July 23, 2013 9:50 PM
Subject: Re: [Rd] cbind error with check.names

On Tue, Jul 23, 2013 at 9:18 AM, Fg Nu <fgnu32 at yahoo.com> wrote:
>
>
>
> Here is an example where cbind fails with an error when check.names=TRUE is set.
>
> data(airquality)
> airQualityBind =cbind(airquality,airquality,check.names =TRUE)
>
>
>? I understand that cbind is a call to data.frame and the following works:
> airQualityBind =data.frame(airquality,airquality,check.names =TRUE)
> but I would like to understand why cbind throws an error.
>
> I asked this question on SO here:
> http://stackoverflow.com/questions/17810470/cbind-error-with-check-names
> and user Hong Ooi confirmed my suspicion that cbind was passing check.names = FALSE regardless of my setting that option, even though the help file indicates that this should be possible,
>
> "For the "data.frame" method of cbind these can be further arguments to data.frame such as stringsAsFactors."
>
> Is there some design principle that I am missing here?


Well, the function does work as documented. See the help file section
on "Data frame methods", which says "The 'cbind' data frame method is
just a wrapper for 'data.frame(..., check.names = FALSE)'".

Best,
Ista



Is there then a reason that overriding the check.names default is forbidden from cbind? I can't tell why this would be the case.

Thanks




[Rd] cbind error with check.names
Fg Nu