Hi,

I have to import multiple R-files.
Each file consists of several functions with the same function name across the 
R-files.

When I import all files one by one (with source()) I overwrite the function 
definition of the previous file until only the very last function definition 
lasts.
However, I need them separately (although they have the name, they solve a 
certain task differently).

Now I thought about creating a separate environment for each file / 
function-group, but I do not know upfront how many files I have to import and 
therefore how many different environments I need.
But since the creation of an environment works like variable assignments (myEnv 
<- new.env()) I cannot just loop over the number of files and create x 
environments.

What is the best way to solve this problem of importing functions without 
overwriting already existing functions with the same name?


Thanks!
______________________________________________
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