Hello,

I wonder how I might create a package that only reveals some of the function
in the package to the user.

I've tried creating an R package using the following:
f <- function(x,y) x+y
g <- function(x,y) x-y
h <- function(x,y) f(x,y)*g(x,y)

package.skeleton(list=c("f","g","h"), name="mypkg")

and would like only h() to be available when I load it, and exposed.
I tried creating a file called NAMESPACE that has one line:
export(h)
But after running R CMD install, when I try to load it with:
library("mypkg",lib.loc=...) i get "Error in namespaceExport(ns, exports) :
undefined exports: h"/
What am I doing wrong?


(BTW, side question, if, after loading, i overload f() or g() with a new
definition from the R console, will h() be affected?)

Thanks,
Eran Eidinger.

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to