<div dir="ltr">Dear Christian<div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 30, 2014 at 8:48 PM, Christian Gunning <span dir="ltr"><<a href="mailto:xian@unm.edu" target="_blank">xian@unm.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><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>
</blockquote><div>I tried your suggestion (using also 'export_all = FALSE')  but I got the warning message</div><div><div><br></div><div>Loading Hello</div><div>Warning in setup_ns_exports(pkg, export_all) :</div>
<div>  Objects listed as exports, but not present in namespace: .package, helloRcpp1, helloCpp1, helloC1, helloF1</div><div><br></div><div>and the successive error message   </div><div><br></div><div>Error in print(helloF1(ny)) : could not find function "helloF1"</div>
</div><div><br></div><div>(where "helloF1" is one of the functions I'm testing).</div><div>Note that I exported in the NAMESPACE file all functions listed in above warning message.</div><div><br></div><div>Thank you for your help</div>
<div>Fabrizio Cipollini</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<p dir="ltr">---Christian <br></p>
<p dir="ltr">Quote:</p><div class=""><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.</div><p></p>
<p dir="ltr">>From time to time, I use R to develop my own packages.</p><div class=""><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***.</div><p></p>
<p dir="ltr">I'm able to do this with the command</p><div class=""><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)</div><p></p><div class=""><div class="h5">
<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.</p></div></div></blockquote></div>
</div></div>