Add hexbin to a globe.

globe_hex(globe, ..., data = NULL, inherit_coords = TRUE,
  on_click = NULL, on_right_click = NULL, on_hover = NULL)

Arguments

globe

An object of class globe as returned by create_globe, or an object of class globeProxy as returned by globeProxy.

...

Coordinates, as specified by coords.

data

A data.frame of points to draw.

inherit_coords

Whether to inherit the coordinates (coords) from create_globe. Only applies to method applied to object of class globe4r not on objects of class globeProxy.

on_click, on_right_click, on_hover

JavaScript functions as JS or TRUE to pick up the event from Shiny server side, see example in globe_bars.

Coordinates

Valid coordinates (depending on layer).

  • lat, lon,

  • altitude

  • margin

  • weight

  • resolution

  • merge

  • transition

Examples

# basic create_globe() %>% globe_pov(-21, 179) %>% globe_hex(coords(lat, long, weight = 1L), data = quakes) %>% scale_hex_side_color(max = 5) %>% scale_hex_cap_color(max = 5) library(shiny) ui <- fluidPage( actionButton("add", "Add hex"), globeOutput("globe") ) server <- function(input, output){ output$globe <- renderGlobe({ create_globe() }) observeEvent(input$add, { globeProxy("globe") %>% globe_hex(coords(lat, long, weight = mag), data = quakes) %>% globe_pov(-21, 179) }) }
# NOT RUN { shinyApp(ui, server) # }