Reputation: 375
Let's say I have function
foo <- function (x, y){
x <- y + 5
}
I save my work with save.image(file= file_name)
Then I load data with load(file, envir=.GlobalEnv)
Let's say I load the data, but after that I modify my function say:
foo <- function (x, y){
x <- y + 10
}
If I run it, it will ignore my new version of function. Why does this happend and how to correct it?
Upvotes: 0
Views: 223
Reputation: 353
It is working well with me and I couldn't find out why you can't overwrite your function. But here are some thoughts:
load(file)
without determining the environoment. (in this case it will be envir = parent.frame()
).hope that could help :)
Upvotes: 0