使用 Roxygen2 导出的函数正在导出我代码中的所有函数,而不是我想要的函数

Funtion exporting with Roxygen2 is exporting all the functions in my code instead of the one I want

我是第一次构建自己的程序包,它终于可以毫无问题地构建了。问题是我只使用 Roxygen2 (6.0.1) 导出一个函数,因为它是唯一要使用的函数,但是当我构建和加载我的包时,其中存在的所有函数都被导出。 (当我看 package:: 时)

我一直在寻找类似的事件,但没有找到

这是函数之前的 Roxygen 注释:

#' Do a plot
#'
#' @param region a GRange object with chr, start, end
#' @param genome a character vector "hg19","hg38" or "mm10"
#' @param BAM a path to the BAM related csv input file
#' @param BED a path to the BED related csv input file
#' @param avgTrack a logical indicating if the average track should be present or not
#' @param geneTrack a logical indicating if the gene track should be present or not
#' @param max a vector of number containing the maximum of each BAM track
#'
#' @export
myfunction <- function(){}

这是 Roxygen2 生成的命名空间:

# Generated by roxygen2: do not edit by hand

export(myfunction)
importFrom(GenomicRanges,findOverlaps)
importFrom(IRanges,elementNROWS)
importFrom(IRanges,splitAsList)
importFrom(S4Vectors,List)
importFrom(S4Vectors,queryHits)
importFrom(S4Vectors,subjectHits)
importFrom(S4Vectors,subjectLength)
importFrom(biomaRt,getBM)
importFrom(grDevices,hcl)
importFrom(graphics,axis)
importFrom(graphics,legend)
importFrom(graphics,lines)
importFrom(graphics,par)
importFrom(graphics,plot)
importFrom(graphics,plot.new)
importFrom(graphics,rect)
importFrom(graphics,segments)
importFrom(graphics,text)
importFrom(rbamtools,bamCount)
importFrom(rbamtools,bamReader)
importFrom(rbamtools,getRefCoords)
importFrom(utils,read.table)

当我执行 mypackage:: 我应该只有一个函数显示 (mypackage::myfunction) 时,我得到了代码中的所有函数。

因此,出于某些原因,当我将 NAMESPACE 从 export(myfunction) 修改为 export("myfunction") 时,我得到了预期的结果。

也可以通过使用 #' @export "myfunction" 和 Roxygen2 语法来实现。