[R] namespace? environment? how to manage functions?

whizvast whizvast at gmail.com
Fri Jun 19 02:16:49 CEST 2009


Hi, useRs-

I have been building a set of functions over time and now my R_GlobalEnv
becomes
too crowded. 

I would like to put all my functions under the same namespace/environment.
Ideally, 
I would like to call them using "env::func" as in C++. 

The following code almost do the jobs I want - except that I need to add
"env$" 
before defining each function. I can't do that because my functions are
saved in 
different files. 

Anybody has any suggestion? Thx~


## test code ##
abc <- new.env()
abc$tmpf <- function() print('hello, world!')
attach(abc)

abc$tmpf()
tmpf()


-- 
View this message in context: http://www.nabble.com/namespace--environment--how-to-manage-functions--tp24100485p24100485.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list