-
Notifications
You must be signed in to change notification settings - Fork 968
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
accessing .SD via data.table::.SD gives NULL #2306
Comments
no, it's not a legal way of accessing .SD. the object is created within the
[] call; it's not an exported object.
…On Aug 16, 2017 7:20 PM, "spennihana" ***@***.***> wrote:
I wasn't able to find an answer to this via searching SO/issues, so I'll
just ask:
Is this legal way of accessing .SD:
someFun <- function(dt) {
...
}
r <- data.table::data.table(r)
r[ , someFun(data.table::.SD, paramData)
, by=.(col3)
, .SDcols=c("col1", "col2")
]
In `someFun`, the arg `dt` is NULL. Not a huge pain since I can do an explicit package import, but curious never-the-less.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2306>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHQQdWriPZlKLK35_cqKNwfmwmJ5Lvx2ks5sY3kxgaJpZM4O5mLh>
.
|
Thanks for your response; it's still bothersome that there's no way of telling data.table to get the groups without explicitly importing the package. At first I was confused by what you meant by "not exported" (https://github.com/Rdatatable/data.table/blob/master/NAMESPACE#L27), but I see that you mean it's built on-the-fly. I want to import and use data.table in this way, without explicitly setting it in my DESCRIPTION:depends. Any trick here? |
why not just import it? using data.table without importing the C code is
bound to end poorly.
…On Aug 16, 2017 7:52 PM, "spennihana" ***@***.***> wrote:
Thanks for your response; it's still bothersome that there's no way of
telling data.table to get the groups without explicitly importing the
package.
At first I was confused by what you meant by "not exported" (
https://github.com/Rdatatable/data.table/blob/master/NAMESPACE#L27), but
I see that you mean it's built on-the-fly.
I want to import and use data.table in this way, without explicitly
setting it in my DESCRIPTION:depends. Any trick here?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2306 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHQQdStqPlsPngXB-Okg1bUduexug5DNks5sY4C7gaJpZM4O5mLh>
.
|
when developing a package id like to access via the package namespace. Among other things it avoids noisy startup messages that I don't want to appear. |
@spennihana did you tried just |
Tried bare It is desirable for all packages to be in Imports. I do not want them in Depends. Yes, this R package is following a strict style of |
Actually, I got a hint on how to handle this from Matt via: #850 I will set these to NULL just before usage. Thanks! |
I'm having the same issue. Could somebody elaborate on the solution? I imported
but
just prints Tried setting
Can anybody fix my example? (Tried |
Have you imported |
I have done that now and it indeed works, thanks! |
@f2ostie see also the new vignette: https://rdatatable.gitlab.io/data.table/library/data.table/doc/datatable-importing.html |
…n with new use_merge argument
I wasn't able to find an answer to this via searching SO/issues, so I'll just ask:
Is this legal way of accessing .SD:
In
someFun
, the argdt
is NULL. Not a huge pain since I can do an explicit package import, but curious never-the-less.edit: fixed up example
The text was updated successfully, but these errors were encountered: