You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Conflicting date time accessors with lubridate #1135
A lot of people, including myself, use both data.table and lubridate routinely. So this overlap is rather an inconvenience. There was even a recent bug report to lubridate as a result of the name collision.
Given that data.table is not dedicated package for working with date-times I wonder if date-time functionality could be split into a separate package or date-time accessors deprecated.
The definitions of these functions in data.table are very basic. In lubridate these are all generics with methods for a variety of classes. Setters are also provided. The default method is the same as it is defined in data.table.
It make sense to attach all exported data.table functions at the beginning of test.data.table(), or eventually detect if exported data.table got masked.
Activity
arunsrinivasan commentedon May 4, 2015
Loading
data.tableand thenlubridateor using::operator should resolve this? Deprecating it for name clashes seems extreme.vspinu commentedon May 4, 2015
The main proposal was to move IDate into a specialized package. It would make data.table a cleaner package.
zippeurfou commentedon Dec 8, 2015
+1
jangorecki commentedon Dec 8, 2015
@vspinu @zippeurfou
Namespace collision can always happen, what if the next version of other popular package creates a function with overlapping name?
importFrominNAMESPACEfile in your package.::operator.You may be also interested in How does R handle overlapping object names?.
aryoda commentedon Apr 3, 2018
Note:
Some unit tests of
data.tablefail if you do loadlubridateafterdata.table.IMHO You shouldn't load
lubridateif you want to run theunit tests to verify the correct installation of
data.table!If you reset the R session and load
data.tablefirst you will get some unit test errorssaying e. g.
mattdowle commentedon Apr 22, 2018
Thanks @aryoda. More to do then, including adding tests to
test.data.table(with.other.packages=TRUE).jangorecki commentedon Mar 12, 2019
It make sense to attach all exported data.table functions at the beginning of test.data.table(), or eventually detect if exported data.table got masked.
attach functions in case of lubridate/zoo #1135
MichaelChirico commentedon Apr 12, 2024
Currently passes. Closing.