-
Notifications
You must be signed in to change notification settings - Fork 507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I render a shiny map in rmarkdown #22
Comments
It is just like all traditional Shiny output elements, i.e. use |
I was hoping to code directly in Rmarkdown without the need to wrap it in an embedded shinyApp |
I think you can just replace observe() with renderLeaflet(). |
I think you just need to add runtime: shiny to the YAML and then you can use leaflet in reactives. It would be something like this: renderLeaflet({
data <- calcs involving input$var
glimpse(data) # confirmscorrect values in console
leaflet(data) %>%
addTiles() %>%
addCircleMarkers(info based on data)
}) @yihui does that look right? |
@jjallaire Exactly. Here is a minimal example:
|
Thanks for assistance |
Hi
I have no problems creating a static leafletmap in rMarkdown. However I'm not sure how to render one where there is an input variable. This approach creates the data OK but does not render map.
observe({
data <- calcs involving input$var
glimpse(data) # confirmscorrect values in console
leaflet(data) %>%
addTiles() %>%
addCircleMarkers(info based on data)
})
should I be using renderLeaflet somehow or adding a binding similar to that used for ggvis in rMarkdown
The text was updated successfully, but these errors were encountered: