<p dir="ltr">Have you tried Hadley's devtools package? It probably has the best tools for auto-reloading packages. On occasion it will jam on me and I have to restart R, but most times load_all("Hello", recompile=T) should do what you want.</p>

<p dir="ltr">---Christian <br></p>
<p dir="ltr">Quote:<br>
Dear everybody<br>
I apologize whether this question has been already answered but I read the<br>
documentation and I surfed the web without solving my issue.</p>
<p dir="ltr">>From time to time, I use R to develop my own packages.<br>
For testing purposes, I need frequently<br>
***to detach the previous version and attach a more recent built without<br>
leaving the R session***.</p>
<p dir="ltr">I'm able to do this with the command<br>
detach(name = "Hello", unload = TRUE, force = TRUE)<br>
if I include in the source package a<br>
zzz.R file<br>
with the function<br>
.onUnload <- function(libpath = NULL)<br>
{<br>
  library.dynam.unload("Hello", libpath)<br>
}<br>
("Hello" is the name of the package I used for testing)</p>
<p dir="ltr">However, if "Hello" links and imports "Rcpp" (and an import(Rcpp) directive<br>
is included in NAMESPACE) all this stuff does not work, in the sense that<br>
even detaching and building a new version of "Hello", the previous one is<br>
attached.<br>
On the other side, if I quit R and I open another session, the last version<br>
of "Hello" is attached successfully.<br>
</p>