I am developing a package containing a ReferenceClass
that has a field of data.table
class (defined in the data.table
package):
MyRC <- setRefClass("MyRC", fields = list(myfield="data.table"))
When I write into package DESCRIPTION
file:
Depends:
data.table
everything is fine. However I heard that one should avoid using Depends
whenever possible, so I rewrote it to:
Imports:
data.table
This however throws an error when building the package:
# Error in refClassInformation(Class, contains, fields, methods, where) :
# class "data.table" for field 'myfield' is not defined
Am I really forced to use Depends
in this case?