The errors when use ggmap with ggplot2
- Dominant language
- R
- Stars
- 778
- Forks
- 234
- PR merge metrics
- No merged PRs in 30d
Description
## Reproducible Example
I am sorry to disturb you. when I used ggmap with ggplot2 (version 3.0) to draw a China map, I faced an error as follows. How to solve it? Thank you.
Error in width_cm(guide$barwidth %||% theme$legend.key.width) :
Unknown input
Example:
library(tidyverse)
library(maptools)
library(ggmap)
data(loc2)
CHN_adm2 <- readShapePoly("E:/R_work/REmap/shapefile/CHN_adm2.shp")
plot(CHN_adm2)
CHN_adm2_1 <- fortify(CHN_adm2) #convert to data.frame
x <- CHN_adm2@data
xs <- data.frame(x,id=seq(0:343)-1)
library(plyr)
china_map_data <- join(CHN_adm2_1, xs, type = "full")
qmap('Jiangsu', zoom = 7, maptype = 'toner') +
geom_polygon(aes(x = long, y = lat, group = group), data = Jiangsu,
colour = 'white', fill = 'black', alpha = .4, size = .3)
Jiangsu_map + geom_point(aes(x = lon, y = lat, colour = name, size = name),data = loc2)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.