我正在尝试使用roxygen2在R包中记录一些数据集。只考虑其中一个:
- 我有一个名为
mypkg/data/CpG.human.GRCh37.RDa
的对象 - 其中包含一个名为
CpG.human.GRCh37
的对象 和一个名为:
mypkg/R/cpg-data.R
的文件,其中包含:
#' @name CpG.human.GRCh37
#' @title CpG islands - human - genome build: GRCh37/hg19
#' @description This data set list the genomic locations of human CpG islands,
#' with coordinates based on the GRCh37 / hg19 genome build.
#' @docType data
#' @usage CpG.human.GRCh37
#' @format a \code{RangedData} instance, 1 row per CpG island.
#' @source UCSC Table Browser
#' @author Mark Cowley, 2012-03-05
#' @export
NULL
当我使用Roxygen时,会生成 mypkg/man/CpG.human.GRCh37.Rd
文件,其中包含: \docType{data}
\name{CpG.human.GRCh37}
\alias{CpG.human.GRCh37}
\title{CpG islands - human - genome build: GRCh37/hg19}
\format{a \code{RangedData} instance, 1 row per CpG island.}
\source{
UCSC Table Browser
}
\description{
This data set list the genomic locations of human CpG
islands, with coordinates based on the GRCh37 / hg19
genome build.
}
\author{
Mark Cowley, 2012-03-05
}
\usage{CpG.human.GRCh37}
\keyword{datasets}
加入 export(CpG.human.GRCh37)
到 NAMESPACE
文件中,但当我进行 R CMD CHECK
操作时,出现以下错误:
...
** testing if installed package can be loaded
Error in namespaceExport(ns, exports) :
undefined exports: CpG.human.GRCh37
Error: loading failed
...
我没有告诉R去哪里找到这个数据集,尽管我认为 mypkg/data/<name>.RDa
应该是一个很好的第一猜测。任何提示都会很棒。
如果Hadley在看,我注意到没有创建 \usage 部分,并且 @usage 指令被忽略了。
我正在使用 roxygen-2.2.2,在 R 2.13.1 上。
@export
指令是否用于数据集。建议尝试将其移除。 - Brandon Bertelsen