[datatable-help] Integration with magrittr

Michael Nelson michael.nelson at sydney.edu.au
Tue Jun 30 03:18:55 CEST 2015


:= isn't actually defined as a function by data table., it only works within a call to [.data.table as the j argument, and is recognised by parsing the j expression (within the function call). 
This I would think it would need to be a feature request. 



> On 30 Jun 2015, at 11:07 am, Michael Smith <my.r.help at gmail.com> wrote:
> 
> All,
> 
> I love data.table and I also love magrittr. However, some things don't work, e.g.
> 
> DT <- data.table(a = 1:3, b = 4:6)
> DT[, a %<>% `*`(2)]    # instead of DT[, a := a %>% `*`(2)]
> 
> Is there some way to make it work or am I missing something? I understand it's because how data.table is essentially a DSL and parses things in its own ways. Is there a workaround or should I post a feature request?
> 
> Thanks,
> M
> _______________________________________________
> datatable-help mailing list
> datatable-help at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help


More information about the datatable-help mailing list