README.md

datamaps

Travis-CI Build Status AppVeyor Build Status CRAN CRAN_Status_Badge

proxies

R htmlwidget for datamaps, plot choropleth, overlay arcs and bubbles, customise options, easily interact with Shiny proxies.

Installation

# CRAN release
install.packages("datamaps")

# Development version
devtools::install_github("JohnCoene/datamaps")

Development version includes 2 plugins, add_icons and add_markers.

Info

Shiny Proxies

Examples

Example proxy.

demo

library(shiny)

ui <- fluidPage(

  textInput(
    "from",
    "Origin",
    value = "USA"
  ),
  textInput(
    "to",
    "Destination",
    value = "RUS"
  ),
  actionButton(
    "submit",
    "Draw arc"
  ),
  datamapsOutput("map")
)

server <- function(input, output){

  arc <- reactive({
    data.frame(from = input$from, to = input$to)
  })

 output$map <- renderDatamaps({
   datamaps()
 })

 observeEvent(input$submit, {
   datamapsProxy("map") %>%
     add_data(arc()) %>%
     update_arcs_name(from, to)
 })

}

shinyApp(ui, server)
}


Try the datamaps package in your browser

Any scripts or data that you put into this service are public.

datamaps documentation built on May 2, 2019, 1:09 p.m.