我想允许用户扩展我在包中定义的引用类。这是一个玩具示例:
# my_package/R/Main.R
#' My Main class
#' @export
Main <- setRefClass("Main")
加载此包后,当我尝试扩展它时收到警告:
library(my_package)
Child <- setRefClass("Child", contains = "Main")
# Warning message:
# Class "Main" is defined (with package slot ‘my_package’) but no metadata object found to revise subclass information---not exported? Making a copy in package ‘.GlobalEnv’
我如何摆脱这个警告?