2012-10-11 13 views
5

我試圖在ggmap中使用gglocator函數。我得到以下錯誤:試圖在ggplot2中使用gglocator:vpPathFromVector(名稱)中的錯誤

Error in vpPathFromVector(names) : 
A viewport path must contain at least one viewport name 

我發現它試圖用gglocator與ggmaps的時候,卻單獨與GGPLOT2發生同樣的錯誤。這裏是它將如何出現的一個例子:

library(ggplot2) 
library(ggmap) 
df <- data.frame(xvar = 1:10, yvar = 1:10) 
qplot(xvar, yvar, data = df) + annotate(geom = 'point', x = 3, y = 6) 
gglocator(4) 

Error in vpPathFromVector(names) : 
A viewport path must contain at least one viewport name 

我在Windows 7上使用RStudio v 0.96.331。我有最新版本的ggplot2。

+0

我不知道是否需要更改ggplot已打破此功能的代碼。您是否嘗試聯繫該軟件包的維護人員:David Kahle [email protected]? –

+0

不,我沒有。我對這個東西很新,所以我認爲這很可能是我做錯了。 –

回答

0

我使用gglocator(Windows XP)有相同的視口錯誤消息。

將以前版本的ggplot2和gmap文件夾 轉移到R庫和gglocator現在可以再次正常工作。

對不起,太急於驗證哪些版本使用 ,但可以在需要時提交。

我的預感是gglocator問題在ggplot2中,我今天(2012年10月27日)更新了 。

+0

你會提請你降級ggplot2版本,以解決錯誤? –

+0

只是看到你的問題後,檢查是否可以運行ggmap 和ggplot2的更高版本。我降級到ggplot 0.9.1和gglocator再次正常工作(Windows XP)。 – Tony