程序:
library(sp)
library(chinamap)
library(maps)
library(mapproj)
library(ggthemes)
library(ggplot2)
zhibiao=read.csv(file='https://github.com/ljtyduyu/DataWarehouse/blob/master/Rstudy/Province/chinaprovincecity.csv
',header = T)
cn<-get_map_china()
summary(cn)
ggplot()+geom_map(aes(x=long,y=lat,map_id=id),map=cn,data=cn,colour='black',fill='white')+
coord_map()+
geom_point(data=zhibiao,aes(x=jd,y=wd,size=zhibiao),colour='red',
alpha=0.5)+
theme_map()+
theme(legend.position = c(.1, .25))
但总是出现这样的错误:
Warning: Ignoring unknown aesthetics: x, y
Don't know how to automatically pick scale for object of type data.frame. Defaulting to continuous.
错误: Aesthetics must be either length 1 or the same as the data (114): size
好像x、y读不出,求解决办法,谢谢


雷达卡




京公网安备 11010802022788号







