<div dir="ltr">Dear everybody<div>I apologize whether this question has been already answered but I read the documentation and I surfed the web without solving my issue. </div><div><br></div><div>From time to time, I use R to develop my own packages.</div>

<div>For testing purposes, I need frequently </div><div>***to detach the previous version and attach a more recent built without leaving the R session***.</div><div><br></div>




<div>I'm able to do this with the command</div><div><span style="color:rgb(0,0,0)">detach(name = "Hello", unload = TRUE, force = TRUE)</span></div><div>if I include in the source package a<br></div><div>zzz.R file</div>





<div>with the function</div><div><div>.onUnload <- function(libpath = NULL)</div><div>{</div><div>  library.dynam.unload("Hello", libpath)<br></div><div>}</div><div>("Hello" is the name of the package I used for testing)</div>

<div><br></div><div>However, if "Hello" links and imports "Rcpp" (and an import(Rcpp) directive is included in NAMESPACE) all this stuff does not work, in the sense that even detaching and building a new version of "Hello", the previous one is attached.</div>
<div>On the other side, if I quit R and I open another session, the last version of "Hello" is attached successfully.<br>
</div><div><br></div><div>I experimented different ways to solve the issue without any success.<br></div></div><div>Any help would be appreciated. I include my sessionInfo() below.</div><div><br></div><div>Best regards</div>
<div>
Fabrizio Cipollini</div><div><br></div><div><br></div><div><div>> sessionInfo()</div><div><br></div><div>R version 3.1.1 (2014-07-10)</div><div>Platform: x86_64-pc-linux-gnu (64-bit)</div><div><br></div><div>locale:</div>
<div> [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=custom.UTF-8       LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8      </div>
<div> [8] LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       </div><div><br></div><div>attached base packages:</div><div>[1] stats     graphics  grDevices utils     datasets  methods   base     </div>

<div><br></div><div>other attached packages:</div><div>[1] Hello_2014.08-1</div><div><br></div><div>loaded via a namespace (and not attached):</div><div>[1] Rcpp_0.11.2</div></div><div><div>
</div></div></div>