I am trying to use a function insertSource(new in R 2.12) to update a function that has been modified.
However, when I use the function in this way:
insertSource('filename.R', package = 'mypackage')
I get an error message:
Error in get(this, envir = envp) : object '.cacheOnAssign' not found
Unfortunately, I cannot come up with a simple reproducible example - if it were useful, suggest how I can do this, but I found that the following code really works:
system("echo 'nls <- function(nls) return(nls)' > foo.R")
insertSource('foo.R', package = stats)
One of the differences between the statistics package and mypackage is the location of the library (mypackage is in '~ / lib / R /. (Update): the error still occurs when it .libPaths('~/lib/R')is in .Rprofileand googleing'.cacheOnAssign' only returns 6 hits, two of them to this question.
Questions:
- What does the error mean?
insertSource?
options(error = recover)
options(error = recover)
Error in get(this, envir = envp) : object '.cacheOnAssign' not found
Called from: get(this, envir = envp)
Browse[1]> where
where 1: get(this, envir = envp)
where 2: insertSource("filename.R", "mypackage")
Browse[1]> ls()
[1] "q"
Browse[1]> n
>
, ,
options(error = browser), ,