I am building my own package for the first time and it is finally building with no problems. The problem is that I am exporting only one function with Roxygen2 (6.0.1) as it is the only one to be used but when I build and load my package, all the function present in it are exported. (When I look with package:: )
I've been searching for similar occurrences but didn't find any
Here is the Roxygen comments just before the function:
#' 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(){}
And here is the NAMESPACE that is generated by 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)
when I do mypackage:: I should have only one function showing (mypackage::myfunction) by I get all the functions that are in my code instead.
#' @export
on all your functions? – SymbolixAU#' @export
. Then I have 30 other functions that are used by the main function but that are not tagged with#' @export
. Those are to be loaded with the package but I don't want them to be usable by the user. – ThomasBuild > Configure Build Tools > Generate Documentation with Roxygen > Configure > Install and Restart
checked? (sometimes this gets reset) – SymbolixAU