2016-06-10 59 views
0

谷歌圖表具有覆蓋功能,允許您將圖像放在指定位置的圖上。這可能在googleVis包中,還是需要特別編輯圖表html才能包含覆蓋層?谷歌圖表覆蓋使用GoogleVis包中的R

+0

您使用'knitr'產生的輸出有效的API密鑰?如果是這樣,我懷疑你可以用'includes' YAML參數找出一些東西,如下所示:http://rmarkdown.rstudio.com/html_document_format.html#includes。在覆蓋文檔(https://developers.google.com/chart/interactive/docs/overlays#overview)之後,您需要將樣式信息放置在由'googleVis'生成的圖表腳本以及之後的正文信息之前。 – joemienko

+0

不。我使用R來生成Google Chart的代碼,然後根據需要編輯該代碼。 –

回答

0

您可以使用我的googleway包在Google地圖上添加疊加層。 要使用谷歌地圖,你需要

library(googleway) 
map_key <- 'your_api_key' 

google_map(key = map_key) %>% 
    add_overlay(north = 40.773941,south = 40.712216, east = -74.12544, west = -74.22655, 
          overlay_url = "https://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg") 

enter image description here