Skip to content

[.data.table requires import of other function to work when data.table is imported by package #2341

Closed
@sz-cgt

Description

@sz-cgt

When writing packages, I generally declare an Imports dependency in the DESCRIPTION then use fully qualified names when invoking the package functions, e.g. data.table::fread().

However, this method fails to import the S3 methods into a namespace that my package can use. Specifically, [ fails and falls back to the [.data.frame unless I explicitly import at least one function from the data.table package in my NAMESPACE. While I can add importFrom(data.table, ...), it seems a bit of a hack to me.

Is this a data.table specific issue, or a general failing in R that requires with regard to S3 methods in package namespaces?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions