-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Function defined in package does not work with data table #548
Comments
Does your new package Depend or Import data.table? See : |
Thanks @mattdowle! When I add I'll take a closer look at why this needs to be done :) |
This implies that if any package that want to work with In my case, the test package defines a general purpose function |
@arunsrinivasan wrote:
But |
Add |
Great. If you could close the issue then please, and related ones. |
The problem occurs with both CRAN version and latest dev of dplyr.
When I'm trying to create some closures to simplify some work, I found the following errors.
Fails with closure produced in a package function
A minimal reproducible example:
When the following function is evaluated in global environment, it works fine.
However, if
test()
is defined and exported in a package, it does not work any more whendata
is adata.table
andfun
is a dplyr verb function. For example,Fails with ordinary package function
After some testing, I found that the original problem is a bit indirect. The same problem occurs simply with ordinary function as long as it is defined in a package.
If I evaluate the following function in global environment, it works fine.
If
test1()
is a package function likethen it no longer works (same problems occur as shown in previous section)
My session info
See also: renkun-ken/pipeR#28.
The text was updated successfully, but these errors were encountered: