gbp
gbp copied to clipboard
data.table Depends->Imports
Thanks for using data.table
! We noticed you are Depend
ing on us and recently decided to strongly discourage downstream packages from doing so -- we think Imports
is always better.
This PR attempts to make the migration from Depends to Imports for data.table
.
If you have a strong reason for preferring Depends
, we'd love to hear it over at our issue tracker:
https://github.com/Rdatatable/data.table/issues/3076
HI, @MichaelChirico ,
Could you advice me on defining .N and :=
in bpp_viewer.r?
.N = NULL
`:=` = function(...) NULL
I think we want .N and :=
to be called from data.table, but what would happen when we overwrote them local (i mean bpp_viewer.r)?
Thank you very much!
data.table
also defines .N
as NULL
and :=
to be a dummy function.
.N
and :=
are done with non-standard evaluation within [.data.table
-- we examine the expression and look specifically for these (and other) symbols and then interpret them within that context.
Moreover, in terms of inheritance, when .N
is being used in your package, it's evaluated by [.data.table
, the parent environment of which is the data.table
package environment, where .N
is defined as NULL
by us.
So, the value you define in your package environment is (1) never seen by data.table
and (2) not on the right inheritance path anyway -- the version in data.table
will always be seen first.
Doing this is just a ruse to trick R CMD check
into passing your package while using NSE variables :)