[R] import function without overwriting function with the same name

Martin Batholdy batholdy at googlemail.com
Sat Aug 3 23:04:55 CEST 2013


> env.lst <- lapply(1:5, new.env)
> 
> seems to work just fine

ok, as far as I understand I would create 5 new environments by this.
But how do I access and change the environment?
What is the name of the environment?


Here is a more concrete example and the general problem:

source('functions1.R')
source('functions2.R')

now functions1.R and functions2.R contain function definitions with the same function-names.
So as soon as I execute source('functions2.R'), I overwrite the function definitions already imported by source('functions1.R').

How can I avoid this?


More information about the R-help mailing list