title: Error in library(ggplot2) : There is no package called 'ggplot2'
body: <p>I'm new to R and I'm just trying to get through some tutorials.</p>
  <p>When I try installing ggplot2, I get this error.</p>
  <pre><code>Error in library(ggplot2) : There is no package called 'ggplot2'
  </code></pre>
  <p>I tried these in R and RStudio.</p>
  <pre><code>install.packages(&quot;ggplot2&quot;, dep=T)
  
  install.packages('ggplot2', repos='http://cran.us.r-project.org')
  
  remove.packages(&quot;ggplot2&quot;)
  </code></pre>
  <p>but I get the error</p>
  <pre><code>(Error in remove.packages : there is no package called 'ggplot2')
  </code></pre>
  <p>This is what I get from install.packages(&quot;ggplot2&quot;)</p>
  <pre><code>&gt; install.packages(&quot;ggplot2&quot;)
  Installing package into ‘.../R/win-library/3.4’
  (as ‘lib’ is unspecified)
  Warning in install.packages :
    'lib = &quot;.../R/win-library/3.4&quot;' is not writable
  trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/ggplot2_2.2.1.zip'
  Content type 'application/zip' length 2784566 bytes (2.7 MB)
  downloaded 2.7 MB
  
  package ‘ggplot2’ successfully unpacked and MD5 sums checked
  Warning in install.packages :
    cannot remove prior installation of package ‘ggplot2’
  
  The downloaded binary packages are in
      C:...\AppData\Local\temp\RtmpqaGNpr\downloaded_packages
  </code></pre>
  <p>I removed all ggplot2 files manually then tried to install again. Here's my result.</p>
  <pre><code>&gt; install.packages(&quot;ggplot2&quot;)
  Installing package into ‘.../R/win-library/3.4’
  (as ‘lib’ is unspecified)
  --- Please select a CRAN mirror for use in this session ---
  trying URL 'https://ftp.osuosl.org/pub/cran/bin/windows/contrib/3.4/ggplot2_2.2.1.zip'
  Content type 'application/zip' length 2784566 bytes (2.7 MB)
  downloaded 2.7 MB
  
  package ‘ggplot2’ successfully unpacked and MD5 sums checked
  Warning: unable to move temporary installation ‘...\R\win-library\3.4\file26b43a54980\ggplot2’ to ‘...\R\win-library\3.4\ggplot2’
  
  The downloaded binary packages are in
          C:...\AppData\Local\temp\Rtmpq0T9a6\downloaded_packages
  &gt; library(ggplot2)
  Error in library(ggplot2) : there is no package called ‘ggplot2’
  &gt; library(&quot;ggplot2&quot;)
  Error in library(&quot;ggplot2&quot;) : there is no package called ‘ggplot2’
  </code></pre>
  <p>These code was run using R 3.4.2</p>