[datatable-help] Using := in .onLoad

Juan Manuel Truppia jmtruppia at gmail.com
Tue Jan 20 12:33:14 CET 2015


I already know that. I usually struggle when using data.table inside my own
packages. I start by listing it in imports only (and not importing
anything) but end up depending on it, as for the users to be able to
manipulate the data.tables with [ and :=. I end up importing some or all of
data.table also, because I don't know how to call := the :: notation.
My specific problem was on using := during on.Load. I already know how to
use it, and know that it can only be used inside [.
Maybe it is imperative to @import data.table to be able to use :=?

On Mon, Jan 19, 2015, 19:35 Arunkumar Srinivasan <aragorn168b at gmail.com>
wrote:

> Within the square brackets in "DT[ .... ]" and even there, only in `j` (as
> the error message points out).
>
> On Mon, Jan 19, 2015 at 11:31 PM, Juan Manuel Truppia <jmtruppia at gmail.com
> > wrote:
>
>> Arun, what does "within the frame of data.table" mean?
>>
>> On Mon, Jan 19, 2015, 19:17 Arunkumar Srinivasan <aragorn168b at gmail.com>
>> wrote:
>>
>>> Juan,
>>>
>>> `:=` is designed to be used only within the frame of data.table.
>>>
>>> On Mon, Jan 19, 2015 at 10:45 PM, Juan Manuel Truppia <
>>> jmtruppia at gmail.com> wrote:
>>>
>>>> Hi, I'm using data.table inside my own packages. I'm having some
>>>> trouble using data.table functions on my .onLoad method.
>>>> I'm actually depending (not importing) data.table, but even then, I
>>>> can't get := to work in .onLoad.
>>>> I'm using the `:=`(a = x, b = y) version, and getting
>>>>
>>>> Error in `:=`(a = x) :
>>>> Check that is.data.table(DT) == TRUE. Otherwise, := and `:=`(...) are
>>>> defined for use in j, once only and in particular ways. See help(":=").
>>>>
>>>> If I comment that, and then run it from the console after the package
>>>> is loaded, it works.
>>>>
>>>> Any ideas?
>>>>
>>>> _______________________________________________
>>>> 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
>>>>
>>>
>>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20150120/1da369ec/attachment.html>


More information about the datatable-help mailing list