devtools::load_all() not reloading edited functions

If I edit an existing function in my R package and then run devtools::load_all(), the loaded function will be the pre-edited version. If I create a new function and run devtools::load_all() then that new function is loaded, and I can use it in my session. Importantly, if I edit the new function, and run devtools::load_all(), then the edits are updated in the new function in my session.

Why is devtools::load_all() not loaded updated functions in my package? I'm guessing that I'm not the only one who has run into this issue, but I cannot find any issues posted about such a problem.

Another annoying thing about devtools::load_all(): the quick key of Cmd/Ctrl + Shift + L doesn't work (I'm using mac RStudio 2022.07.1 ). Instead Cmd/Ctrl + Shift + L just highlights the next line of code, with repeated Cmd/Ctrl + Shift + L highlighting more and more lines of code

1 Like


I was also having the same issue. I've tried to restart the R session and clear the cached files, but no good.

In my case, I had a copy of the same function, with the same name, in a different (untracked) file outside the test/ folder. I found it after running devtools::check(). See if you have the old version of your function in the R/ folder too.


This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.