我是r语言的新手,已经尝试了几个小时在亚利桑那州地图上绘制蝴蝶家族的点。我可能做错了什么或者缺少了一些东西,不确定,希望能得到帮助!
现在我有以下代码,并尝试了许多其他代码:
rio = read.csv("Rioninidae_Cleaned.csv",stringsAsFactors = FALSE)
arizona <- get_googlemap(center=c(lon=-110.713,lat=31.815), zoom = 3)
lon <-data.frame(rio$latitude)
lat <-data.frame(rio$longitude)
df <- as.data.frame(cbind(lon,lat))
df
arizona <- get_googlemap(center = c(lon = -110.713,lat = 31.815), zoom = 3)
ggmap(arizona) +
geom_point(data = df, aes(x = lon, y = lat), size = 5, shape = 21) +
guides(fill = FALSE, alpha = FALSE, size = FALSE)
我的csv文件可以在这里找到:https://www.dropbox.com/s/yxj1uvmt9bw8gvn/Rioninidae_Cleaned.csv?dl=0
该链接指向一个csv文件,您可以通过点击链接来下载该文件。 genus province county latitude longitude
1 Apodemia Arizona Apache 33.90011 -109.5844
2 Apodemia Arizona Cochise County 31.46260 -110.2895
3 Apodemia Arizona Cochise County 31.46260 -110.2895
4 Apodemia Arizona Santa Cruz 31.50503 -110.6547
5 Emesis Arizona Santa Cruz 31.74001 -110.9411
6 Emesis Arizona Santa Cruz 31.74001 -110.9411
7 Emesis Arizona Santa Cruz 31.38333 -111.0833
8 Apodemia Arizona Santa Cruz 31.38333 -111.0833
9 Calephelis Arizona Pima 31.76667 -111.5500
谢谢!