我正试着用Rapache和"Leaflet for R“做一个网页。我安装Rapache的主要原因是在html页面中使用R(在brew中)。但是,我不知道如何在html页面内返回我的地图,而不将其保存为html外部文件(这个Rapache是无用的)。让我们举个例子:
<%
library(leaflet)
m <- leaflet()
m <- addTiles(m)
m <- addMarkers(m, lng=174.768, lat=-36.852, popup="The birthplace of R")
m #Does not show anything
saveWidget(m, file = outPath, selfcontained = FALSE, libdir ='leafletwidget_libs') #work but not proper
%>这是我的html文件中的内容,我希望能够返回此地图(m)并将其添加到当前页面的某个位置。我想这样做的主要原因是因为我要在网站上使用它,我希望它是动态的,而不是创建大量的htmlfile。这是不恰当的。希望你能帮助我:)谢谢你!
发布于 2016-09-07 05:58:11
为了在我们的web仪表板上使用这种类型的文件,我们使用iFrames创建了一个空间,它定义了swidget将加载到的区域,它对我们来说工作得很好。你试过使用iFrames吗?
exapmple code to embed it with suggestions about folder management
您可以使用传统的前端实践来调整框架的大小。
https://stackoverflow.com/questions/34300109
复制相似问题