How to properly set up the library directory/path in R
<p>My goal is to define a single path which <code>R</code> will use for installing and searching for libraries. I <a href="https://stackoverflow.com/questions/15170399/changing-r-default-library-path-using-libpaths-in-rprofile-site-fails-to-work">read</a> that this can be done by changing the <code>Rprofile.site</code> file in the <code>R</code> installation path. I tried two commands there:</p>

<pre><code>.libPaths("D:/RLibrary")
.Library.site &lt;- file.path("D:/RLibrary")
</code></pre>

<p>of which I do not fully understand the difference even after reading the help files.</p>

<p>However after starting <code>R</code>, libraries are still looked for in two locations.</p>

<pre><code>.libPaths()
[1] "D:/RLibrary"                        "C:/Program Files/R/R-3.3.1/library"
</code></pre>

<p>Why is this, and how do I change the library path to my desired path only?</p>