title: How to "reinstall and reload" a local R package?
body: <p>I'm implementing a statistical algorithm into an R package, which will be used in my analysis. The R package is local on my disk.</p>
  
  <p>Since I'm making a lot of changes to the R package, I want my analysis script to reinstall and reload the fresh R package every time it runs.</p>
  
  <p>What's the best way to do this? Currently, I use:</p>
  
  <pre><code>install.packages("~/my_package/", repos=NULL, type="source") 
  library("my_package")
  </code></pre>
  
  <p>However, it seems like I still have to manually tell Rstudio to restart my R session for the fresh version to kick in.</p>