-
Notifications
You must be signed in to change notification settings - Fork 49
na.omit
could not find function; S3 methods not loaded?
#370
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
Comments
box::use(
stats[na.omit]
) |
@ArcadeAntics yes indeed. However, https://rdatatable.gitlab.io/data.table/reference/na.omit.data.table.html The issue is: I believe these are attached on package load event and thus not exported. |
‘data.table’ does not provide its own You can use it by calling box::use(
dt = data.table,
stats[na.omit],
)
trace(data.table:::na.omit.data.table, quote(message('called na.omit.data.table')))
na.omit(dt$data.table(x = 1 : 5)) This will print “called na.omit.data.table”, showing that we called the expected S3 method. (Please see #80 for possible limitations when working with ‘data.table’ inside modules, since ‘data.table’ hard-codes support for packages and certain functionalities it contains may break when used in other contexts due limitations in its data.table-awareness detection. However, in general it should work.) |
Okay thank you both then @klmr @ArcadeAntics! I was wrong and had not understood how this works. Thank you for the |
Error description
I am using
data.table
andR6
classes. I want to usedata.table
na.omit
function on the data but I get the above error.I suspect that it's because
na.omit
is anS3
that has not been loaded. Unfortunately I cannot figure out how to solve this sincena.omit
is not exported fromdata.table
.I really don't want to have to call
library("data.table")
to solve this. Any help or is this indeed a bug?Here's a minimal example.
R6 class module:
main.R
R version
The text was updated successfully, but these errors were encountered: