[R-pkg-devel] Roxygen and Namespace

Jenny Bryan jenny at stat.ubc.ca
Fri Jun 10 17:51:57 CEST 2016


> exportPattern("^[[:alpha:]]+") means

It is a regular expression that basically says "export all the things", meaning the functions provided by your package. I regard it as a placeholder to make things work temporarily, while you get yourself organized for more proactive management of NAMESPACE.

I don't feel like you'll ever see that combined with import directives (as you have below), once you really begin to use roxygen? 

You should put 
#' @export
directives in the roxygen header of every function that should be exported and they will appear in NAMESPACE individually after you roxygenize or run devtools::document().

Somewhere you will also need import directives corresponding to all those imports you want to do. They can go in any roxygen header.

-- Jenny

> On Jun 10, 2016, at 12:04 AM, Knut Krueger <rhelp at krueger-family.de> wrote:
> 
> how can I tell Roxygen to write the namespace like
> 
> exportPattern("^[[:alpha:]]+")
> import(igraph,chron,gdata,XLConnect)
>  importFrom("grDevices", "dev.off", "heat.colors", "postscript",
>     "rainbow")
> importFrom("graphics", "arrows", "lines", "par", "plot", "text",
>     "title")
> importFrom("stats", "na.omit")
> 
> 
> 
> 
> by the way what does exportPattern("^[[:alpha:]]+") means?
> 
> 
> Knut
> 
> ______________________________________________
> R-package-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel



More information about the R-package-devel mailing list