Hi Im trying to make a package in R just to learn how it works.

One thing I dont manage to do is to make a hidden environment or variable so
to say.

I want a "hash list" that I create my useing:

TestEnv<-new.env()
assign("Key1","Ans1",envir=TestEnv)
assign("Key2","Ans2",envir=TestEnv)

Then I just have this function to try it:

TestFunc<- function(Key, ...) UseMethod("TestFunc")

TestFunc.default <- function(Key,...){
Ans<-get(Key, envir=TestEnv)
print(Ans)
}

But when I load this package I can access the TestEnv by just typing
TestEnv, but I want this one hidden so that you only can get the "Ans" from
the "Key" via the TestFunc.

Thx for the help
Joel
-- 
View this message in context: 
http://r.789695.n4.nabble.com/Hidden-variables-tp3251588p3251588.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
[email protected] 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