title: installation of package ‘ggplot2’ had non-zero exit status
body: <p>I am trying to install ggplot2, which I had previously had installed however, I keep on getting an error message saying </p>
  
  <blockquote>
    <p>ggplot2 had non-zero exit status. </p>
  </blockquote>
  
  <p>I have updated R, unistalled and reinstalled it.
  I have also done <code>"install.packaged("ggplot2", dependencies = TRUE)</code>, that did not work, I have tried to install each dependency independently, which did not work.
   I have tried to update some of the dependencies, especially rlang, however, the version nevers changes, so again had no success... 
  This is the error message </p>
  
  <pre><code>&gt;install.packages("ggplot2", dependencies = TRUE)
  Installing package into ‘C:/Users/Liah Brown/Documents/R/win-library/3.3’
  (as ‘lib’ is unspecified)
  also installing the dependency ‘rlang’
  
  
    There are binary versions available but the source versions are
    later:
          binary source needs_compilation
  rlang    0.2.0  0.3.1              TRUE
  ggplot2  2.2.1  3.1.0             FALSE
  
    Binaries will be installed
  trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/rlang_0.2.0.zip'
  Content type 'application/zip' length 754726 bytes (737 KB)
  downloaded 737 KB
  
  package ‘rlang’ successfully unpacked and MD5 sums checked
  
  The downloaded binary packages are in
      C:\Users\Liah Brown\AppData\Local\Temp\Rtmpao258F\downloaded_packages
  installing the source package ‘ggplot2’
  
  trying URL 'https://cran.rstudio.com/src/contrib/ggplot2_3.1.0.tar.gz'
  Content type 'application/x-gzip' length 2863109 bytes (2.7 MB)
  downloaded 2.7 MB
  
  * installing *source* package 'ggplot2' ...
  ** package 'ggplot2' successfully unpacked and MD5 sums checked
  ** R
  ** data
  *** moving datasets to lazyload DB
  ** inst
  ** preparing package for lazy loading
  Error in loadNamespace(j &lt;- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
    namespace 'rlang' 0.2.0 is being loaded, but &gt;= 0.2.1 is required
  ERROR: lazy loading failed for package 'ggplot2'
  * removing 'C:/Users/Liah Brown/Documents/R/win-library/3.3/ggplot2'
  Warning in install.packages :
    running command '"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" CMD INSTALL -l "C:\Users\Liah Brown\Documents\R\win-library\3.3" C:\Users\LIAHBR~1\AppData\Local\Temp\Rtmpao258F/downloaded_packages/ggplot2_3.1.0.tar.gz' had status 1
  Warning in install.packages :
    installation of package ‘ggplot2’ had non-zero exit status
  </code></pre>
  
  <p>The downloaded source packages are in
      ‘C:\Users\Liah Brown\AppData\Local\Temp\Rtmpao258F\downloaded_packages’</p>
  
  <p>My session info is...</p>
  
  <pre><code>R version 3.3.2 (2016-10-31)
  Platform: x86_64-w64-mingw32/x64 (64-bit)
  Running under: Windows &gt;= 8 x64 (build 9200)
  
  locale:
  [1] LC_COLLATE=English_United Kingdom.1252 
  [2] LC_CTYPE=English_United Kingdom.1252   
  [3] LC_MONETARY=English_United Kingdom.1252
  [4] LC_NUMERIC=C                           
  [5] LC_TIME=English_United Kingdom.1252    
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  other attached packages:
  [1] plyr_1.8.4
  
  loaded via a namespace (and not attached):
  [1] tools_3.3.2  yaml_2.1.18  Rcpp_0.12.16
  </code></pre>
  
  <p>And this is my .libPaths()</p>
  
  <pre><code>[1] "C:/Users/Liah Brown/Documents/R/win-library/3.3"
  [2] "C:/Program Files/R/R-3.3.2/library" 
  </code></pre>