Issue plotting with ggmap in R
<p>I am trying to make a map using ggmap pulling the image from google. Below is my code where I am trying to pull a plot of Utah and then plot it. </p>

<p>The plot will not be made because of the error that I receive: "error in as.vector(y) : attempt to apply non-function."</p>

<p>Any clue on what is going on and why it won't work?</p>

<pre><code>R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
#pull map of Utah

Ut.map &lt;- get_map(location=c(-111, 39.5), zoom=7, maptype="roadmap")

Map from URL : http://maps.googleapis.com/maps/api/staticmap?center=39.5,-111&amp;zoom=7&amp;size=640x640&amp;scale=2&amp;maptype=roadmap&amp;language=en-EN&amp;sensor=false

ggmap(Ut.map)

Error in as.vector(y) : attempt to apply non-function
</code></pre>

<p>Edit: 11/14/2016 4:00 pm</p>

<p>I updated R, Rstudio, and ggplot2. Now I receive this error message when I try to load ggplot2:</p>

<pre><code>library(ggplot2)
Error in loadNamespace(j &lt;- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘Rcpp’
Error: package or namespace load failed for ‘ggplot2’
</code></pre>

<p>I tried to install Rcpp and I receive this message:</p>

<pre><code>install.packages("Rcpp")
Installing package into ‘C:/Users/justi/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
trying URL
'https://cran.rstudio.com/bin/windows/contrib/3.3/Rcpp_0.12.7.zip'
Content type 'application/zip' length 3265506 bytes (3.1 MB)
downloaded 3.1 MB

package ‘Rcpp’ successfully unpacked and MD5 sums checked
Warning in install.packages :
unable to move temporary installation ‘C:\Users\justi\Documents\R\win-     
library\3.3\file150426f11cb7\Rcpp’ to ‘C:\Users\justi\Documents\R\win-  
library\3.3\Rcpp’

The downloaded binary packages are in
C:\Users\justi\AppData\Local\Temp\RtmpesXik0\downloaded_packages
</code></pre>

<p>Now I can't run anything related to ggplot or anything. My new R details are:</p>

<pre><code>R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
</code></pre>