Quantcast

check.names in [] operator

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

check.names in [] operator

Yang Zhang
Hi, is there any way to prevent name-munging when [] is used? The
data.table constructor supports check.names but as soon as a join is
performed the names are munged. Thanks.
_______________________________________________
datatable-help mailing list
[hidden email]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: check.names in [] operator

Matthew Dowle
name-munging? Example please.

On Thu, 2012-03-08 at 15:06 -0800, Yang Zhang wrote:
> Hi, is there any way to prevent name-munging when [] is used? The
> data.table constructor supports check.names but as soon as a join is
> performed the names are munged. Thanks.
> _______________________________________________
> datatable-help mailing list
> [hidden email]
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help


_______________________________________________
datatable-help mailing list
[hidden email]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: check.names in [] operator

Yang Zhang
Oh, an example is when I have a column named "Account Name" it gets
munged into "Account.Name".  That's why I was referring to the
check.names argument (same as in other places like read.table).

Actually, I think I was mistaken in thinking that data.table supported
un-munged names at all - I'm not in front of R at the moment but IIRC
when I ran data.table(data.frame('a b'=1), check.names=F) I would get
a column named "a.b".  But I could be completely wrong.

In any case I'm pretty sure after using operator [] any un-munged
names get munged.

Thanks

On Thu, Mar 8, 2012 at 4:37 PM, Matthew Dowle <[hidden email]> wrote:

> name-munging? Example please.
>
> On Thu, 2012-03-08 at 15:06 -0800, Yang Zhang wrote:
>> Hi, is there any way to prevent name-munging when [] is used? The
>> data.table constructor supports check.names but as soon as a join is
>> performed the names are munged. Thanks.
>> _______________________________________________
>> datatable-help mailing list
>> [hidden email]
>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
>
>



--
Yang Zhang
http://yz.mit.edu/
_______________________________________________
datatable-help mailing list
[hidden email]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: check.names in [] operator

Matthew Dowle
Munged is a slightly strong word to describe that. Similar to mangled.
The thinking behind it is to encourage j expressions of column names, like
a database. So column names need to be valid variable names.
However thinking about it, perhaps data.table shouldn't force that on
user. Writing from phone so perhaps you could raise a detailed bug or
feature request.


> Oh, an example is when I have a column named "Account Name" it gets
> munged into "Account.Name".  That's why I was referring to the
> check.names argument (same as in other places like read.table).
>
> Actually, I think I was mistaken in thinking that data.table supported
> un-munged names at all - I'm not in front of R at the moment but IIRC
> when I ran data.table(data.frame('a b'=1), check.names=F) I would get
> a column named "a.b".  But I could be completely wrong.
>
> In any case I'm pretty sure after using operator [] any un-munged
> names get munged.
>
> Thanks
>
> On Thu, Mar 8, 2012 at 4:37 PM, Matthew Dowle <[hidden email]>
> wrote:
>> name-munging? Example please.
>>
>> On Thu, 2012-03-08 at 15:06 -0800, Yang Zhang wrote:
>>> Hi, is there any way to prevent name-munging when [] is used? The
>>> data.table constructor supports check.names but as soon as a join is
>>> performed the names are munged. Thanks.
>>> _______________________________________________
>>> datatable-help mailing list
>>> [hidden email]
>>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
>>
>>
>
>
>
> --
> Yang Zhang
> http://yz.mit.edu/
>


_______________________________________________
datatable-help mailing list
[hidden email]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
Loading...