-
Notifications
You must be signed in to change notification settings - Fork 991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make 'merge.data.table' become an exported S3 method #2618
Comments
Also, please export: data.table:::duplicated.data.table. Thanks. |
|
What I am saying is that I would like to S3 dispatch on merge.data.table without putting data.table on the search path. I would like to use double colons '::'. Triple colons ':::' are not allowed in R CRAN packages. For example, I can do > debug(zoo::as.Date)
> zoo::as.Date(17000)
debugging in: zoo::as.Date(17000)
debug at . . . /zoo/R/as.Date.R But I can not do that in data.table merge > debug(data.table:::merge.data.table)
> merge(data.table(BOD),data.table(BOD), by = "Time")
Error in data.table(BOD) : could not find function "data.table" |
Exporting method won't hurt us anyway and it is sometimes useful. |
@AndreMikulec d = data.table::data.table(a=1L, b=2L)
debug(data.table:::merge.data.table)
merge(d, d) could you provide another use case where exporting |
From your example: suppose the 'd' is created in package 1 and by package 1 function f1. Suppose package 2 function f2 exists and receives as a parameter d. Suppose that in runnable code, function f2 receives as a parameter data.table d like
then package 2 (and function f2) relies on the dependence of package 1(that created d) and that 'package 2 depending on package 1' But S3 is flexible. Using it to dispatch is a good idea (so I agree). However, sometimes I want to be specific. I want to force a certain behavior. Or, I want to be sure that the function that I want is (at least first) called before a dispatch.
An example, is zoo::as.Date (that does S3 dispatch).
Basically, if I call If this response seems harsh ( if it seems that way ) to anyone, then please forgive me? My situation is very difficult to explain. My experience is from working with a very large code set with typically 50-100 imported packages. Thanks. |
Yes, that helps, thank you. |
I can not use data.table:::merge.data.table in R CRAN packages.
is not exported and private access ":::" is not allowed in R CRAN packages.
Please make 'merge.data.table' become an exported S3 method.
Thanks.
Andre Mikulec
The text was updated successfully, but these errors were encountered: