title: Can't install and load ggplot2 on RStudio
body: <p>I've tried to install <code>ggplot2</code> first with <code>install.packages("ggplot2")</code> but after I try to open with library <code>("ggplot2")</code> it gives me this error message:</p>
  
  <pre><code>library ('ggplot2')
  </code></pre>
  
  <blockquote>
    <p>Error in library("ggplot2") : there is no package called ‘ggplot2’</p>
  </blockquote>
  
  <p>Is this because I'm trying to run this on a mac or RStudio instead of R? How can I get it installed?</p>
  
  <p>These are the details of the version I'm using: </p>
  
  <p><strong>RStudio Version 0.99.902 – © 2009-2016 RStudio, Inc.
  Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/604.4.7 (KHTML, like Gecko</strong></p>
  
  <p>Any help would be greatly appreciated!</p>
  
  <p>Here's what I get when I try to install <strong>ggplot</strong> as a package if it helps...</p>
  
  <pre><code>&gt; install.packages("ggplot2")
  Installing package into ‘/Users/crystlewee/Library/R/3.2/library’
  (as ‘lib’ is unspecified) also installing the dependency ‘scales’
  
  There are binary versions available but the source versions are later:
    binary source needs_compilation
  scales   0.4.0  0.5.0              TRUE
  ggplot2  2.1.0  2.2.1             FALSE
  Do you want to install from sources the package which needs compilation?
  y/n: y
  installing the source packages ‘scales’, ‘ggplot2’
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  0 59867    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0100 59867  100 59867    0     0  39753      0  0:00:01  0:00:01 --:--:-- 39752
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0 16 
  * installing *source* package ‘scales’ ...
  ** package ‘scales’ successfully unpacked and MD5 sums checked
  ** libs
  llvm-g++-4.2 -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I"/Users/crystlewee/Library/R/3.2/library/Rcpp/include"   -fPIC  -mtune=core2 -g -O2  -c RcppExports.cpp -o RcppExports.o
  /bin/sh: llvm-g++-4.2: command not found
  make: *** [RcppExports.o] Error 127
  ERROR: compilation failed for package ‘scales’
  * removing ‘/Users/crystlewee/Library/R/3.2/library/scales’
  * restoring previous ‘/Users/crystlewee/Library/R/3.2/library/scales’
  Warning in install.packages :
  installation of package ‘scales’ had non-zero exit status
  * 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(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  namespace ‘scales’ 0.4.0 is being loaded, but &gt;= 0.4.1 is required
  ERROR: lazy loading failed for package ‘ggplot2’
  * removing ‘/Users/crystlewee/Library/R/3.2/library/ggplot2’
  Warning in install.packages :
  installation of package ‘ggplot2’ had non-zero exit status
  
  The downloaded source packages are in
  ‘/private/var/folders/my/vqvl_d89237fcc75nv24lqxw0000gn/T/Rtmpv0MgCR/downloaded_packages’
  </code></pre>