下面的代碼正常工作:ggmap上的ggmap繪製點時/ ggplot錯誤:[參數意味着不同的行數]
library(ggmap)
mp2 <- ggmap::get_map(location="South America", zoom = 4, source="google")
ggmap(mp2) +
geom_point(aes(c(-60), c(-1)), size=15) # plot one single point on map
產生這樣的:
儘管下面由於某些原因,其行爲不如預期:
ggmap(mp2) +
geom_point(aes(c(-60, -65, -62), c(-1, -5, -10)))
givin摹我下面的錯誤:
Error in data.frame(x = c(-60, -65, -62), y = c(-1, -5, -10), PANEL = c(1L, :
arguments imply differing number of rows: 3, 4
'你可以確認ggmap在第3行內部創建的緯度和經度的載體:'print.ggplot(名單(數據=列表(LON = C(-83.5725316875,-27.3225316875, -83.5725316875,-27.3225316875),LAT = C(-34.656848886632,-34.656848886632, 18.9102814177176,18.9102814177176))' – OdeToMyFiddle
嗯我看到......這些都是ggmap的4個角落。 – Dan
您的第一個塊代碼不再工作。你可以測試它並確認它嗎? –