For instance, say I have the following package called Test
and I want to export class A
:
# In /R/Test.R:
#' @docType package
#' @import methods
#' @exportClass A
A <- setRefClass("A", methods = list(foo = identity))
However, after building and loading, I get the following error when using A
's generator:
> library(Test)
> A()$foo(1)
Error: could not find function "A"
I've checked the contents of my NAMESPACE
file is fine:
exportClasses(A)
import(methods)
So what's going wrong? Why isn't my class generator being exported?
@export
/@exportClass
tags are failing to export the class generator. – Hexa@export
as well to export the generator. – Parris