title: Installing packages in R by using binary instead of source files: how to change the default
body: <p>I just updated <code>R</code> and <code>RStudio</code> to the newest versions (R version 3.5.1 (2018-07-02); RStudio Version 1.1.453) on my Macbook Pro last night. And, then I realized that when I try to install packages in RStudio, it installs from source code by compiling it. </p>
  
  <p>I am using general fuction to install packages (i.e., <code>install.packages(XXXX)</code>). Also, I conformed that when I use <code>R</code> instead of <code>RStudio</code>, the <code>R</code> just installs packages by donwloading binary files.</p>
  
  <p>I have to use <code>RStudio</code> but since it is compiling all packages from source codes, this is taking forever! I would really appreciate it if I could hear how can I have <code>RStudio</code> use binary files instead. Thank you for your help.</p>
  
  <pre><code>install.packages("lavaan") 
  </code></pre>
  
  <blockquote>
    <p>Installing package into ‘/usr/local/lib/R/3.5/site-library’ (as ‘lib’ is unspecified) trying
    URL '<a href="https://cran.rstudio.com/src/contrib/lavaan_0.6-1.tar.gz" rel="nofollow noreferrer">https://cran.rstudio.com/src/contrib/lavaan_0.6-1.tar.gz</a>' Content
    type 'application/x-gzip' length 684438 bytes (668 KB)
    ================================================== downloaded 668 KB</p>
    
    <ul>
    <li>installing <em>source</em> package ‘lavaan’ ...
    ** package ‘lavaan’ successfully unpacked and MD5 sums checked
    ** R
    ** data
    <strong>* moving datasets to lazyload DB
    ** inst
    ** byte-compile and prepare package for lazy loading
    ** help
    *</strong> installing help indices
    ** building package indices
    ** testing if installed package can be loaded</li>
    <li>DONE (lavaan)</li>
    </ul>
    
    <p>The downloaded source packages are in
      ‘/private/var/folders/7m/_0cxbz8s02bdp4z7jxk3pky80000gn/T/Rtmp2ThASP/downloaded_packages’</p>
  </blockquote>