title: R mapdata coordinates with ggplot?
body: <p>I'm trying to use the maps and mapdata packages with ggplot, but I can't seem to extract the coordinates out of the data. Specifically, I'm trying to plot certain US states and Canadian provinces. </p>
  
  <pre><code>library(maps)
  library(mapdata)
  library(ggplot2)
  library(ggthemes)
  library(raster)
  us &lt;- getData("GADM", country = "USA", level = 1)
  canada &lt;- getData("GADM", country = "CAN", level = 1)
  states &lt;- c('connecticut', 'new york', 'new jersey', 'massachusetts')
  provinces &lt;- c('Ontario', 'Alberta', 'Quebec')
  
  us.states &lt;- us[us$NAME_1 %in% states, ]
  ca.provinces &lt;- canada[canada$NAME_1 %in% provinces, ]
  
  ggplot(us.states, aes(x = longitude, y = latitude, group = group)) +
    geom_path()+
    geom_path(data = ca.provinces)+
    coord_map()
  </code></pre>
  
  <p>and I get an error: </p>
  
  <pre><code>Regions defined for each Polygons
  Regions defined for each Polygons
  Error in .Call.graphics(C_palette2, .Call(C_palette2, NULL)) : 
    invalid graphics state
  </code></pre>
  
  <p>Any help here? I'm new to mapping in R.</p>