我正在尝试编写一个子类,RJDBC::JDBCConnection
因为我需要自定义方法来dbplyr
使用dplyr#2941中的方法(最初来自这里)连接包。但是,我并没有覆盖这些*.JDBCConnection
方法,而是想为JDBCConnection
.
因此,根据这个 Stack Overflow question的建议,我编写了我的包,基本上是这样的:
### R/testclass.R ####################
#' Test class
#'
#' This extends JDBCConnection in package RJDBC
#'
#' @import RJDBC
#'
setClass("TestConnection", contains = "JDBCConnection")
### DESCRIPTION ######################
Package: test
Type: Package
Title: What the Package Does (Title Case)
Version: 0.1.0
Author: Who wrote it
Maintainer: The package maintainer <yourself@somewhere.net>
Description: More about what it does (maybe more than one line)
Use four spaces when indenting paragraphs within the Description.
License: What license is it under?
Encoding: UTF-8
LazyData: true
我想扩展的类存在,可以用help("JDBCConnection-class", package = "RJDBC")
.
在此包中调用devtools::document()
会返回以下错误:
Updating test documentation Loading test Error in reconcilePropertiesAndPrototype(name, slots, prototype, superClasses, : no definition was found for superclass "JDBCConnection" in the specification of class "TestConnection"
我也尝试按照这个 SO question 替换@import
,@importClassesFrom
但结果是一样的。
我怎样才能document()
跑步?