我正在使用ggmap来处理马达加斯加的 Map
myMap <- get_map(location=k, source="stamen", maptype="toner", crop=FALSE,
zoom=16)
并从x y lat / lon网格绘制该 Map 上的点
ggmap(myMap) + geom_point(data=GPS, aes(x = 'Lon', y ='Lat'))
ggplot(data=GPS, aes(x=Lon,y=Lat)) + geom_point()
来自这样的数据
Tree.ID Type Species Lat Lon Foraged Plot
7 deadwood Dracaena -21.37413 47.86700 N 1
8 deadwood Bivinia -21.37408 47.86696 N 1
9 deadwood Beilschmiedia -21.37396 47.86691 N 1
10 live trunk Ocotea -21.37410 47.86690 N 1
12 deadwood Tambourissa -21.37418 47.86696 N 1
13 live trunk Canarium -21.37422 47.86691 N 1
但我得到这个错误:
Error: Discrete value supplied to continuous scale
我该怎么办?
1 回答
您将字符串
"Lon"
和"Lat"
传递给x
和y
而不是传递Lon
和Lat
本身 . 拿出报价,你应该没事 .