[R] Column name containing "-"

Ivan Calandra ivan.calandra at u-bourgogne.fr
Tue Jan 24 15:47:11 CET 2012


By "it works anyway", I mean that you can have a dash in a column name, 
there is no error or even warning.
I guess that some functions would throw an error or warning, depending 
on the requirements, but data.frame() doesn't.

Ivan

Le 24/01/12 15:35, David Winsemius a écrit :
>
> On Jan 24, 2012, at 4:44 AM, Ivan Calandra wrote:
>
>> Hi Mark,
>>
>> I cannot tell you why (maybe someone else can), but the check.names 
>> argument to data.frame() interpret "a.-5" as an unvalid name and 
>> convert to to a valid one. What I don't understand is why it isn't 
>> "valid" since it works anyway.
>
> The dash is not a valid character for column names. What do you mean 
> by "it works anyway"?
>

-- 
Ivan CALANDRA
Université de Bourgogne
UMR CNRS/uB 6282 Biogéosciences
6 Boulevard Gabriel
21000 Dijon, FRANCE
+33(0)3.80.39.63.06
ivan.calandra at u-bourgogne.fr



More information about the R-help mailing list