R - should you import the `methods` package?

I use setRefClassto create classes and, as part of the package methods, I suggested that you need to declare this dependency as import.

However, the following minimal example fails Rcmd.exe checkwhen importing methods:

#' @docType package
#' @import methods
A <- setRefClass("A")

with the following error (my package is called Test):

==> Rcmd.exe check Test_1.0.tar.gz

<Lots of checks here...>

* checking package dependencies ... ERROR
Namespace dependency not required: 'methods'

See the information on DESCRIPTION files in the chapter 'Creating R
packages' of the 'Writing R Extensions' manual.

Exited with status 1.

So, from what I can understand, it seems to me that they tell me to remove importfor methodsand, therefore, keep the hidden package dependency on methods. Is my interpretation correct, and if so, why hide dependence on methods?

My setup:

  • Roxygen2 3.0.0
  • R: 3.0.2 (Frisbee Sailing)
  • IDE: RStudio 0.98.490
  • OS: Windows 8.1
+3
1

, Imports: methods DESCRIPTION .

+4

All Articles