I'm working on a custom R package, in which I'm using S4 classes and methods.
In one of the methods for a custom S4 class in the same file, I'm using the GET()
method from the httr
package. I tried using roxygen2 to properly set up my NAMESPACE file, having put @importFrom httr GET
in the roxygen2 comment of the method and importing the package in the DESCRIPTION file.
#'
#' @importFrom httr GET
setMethod(f="method_name",
signature="Class_name",
definition=function()
{
...
foo<- GET(url = "bar")
...
}
However, when executing devtools::document()
, I'm getting:
Error in method_name() (from file_name.R#198) : could not find function "GET"
What am I missing here?
UPDATE:
It seems roxygen2 never properly generates a NAMESPACE file. I deleted the old (outdated) one, but devtools::document()
won't create a new one.