library(shiny)
library(leaflet)
library(nycflights13)
library(DT)
parguera <- nycflights13::flights
r_colors <- rgb(t(col2rgb(colors()) / 255))
names(r_colors) <- colors()
ui <- fluidPage(
titlePanel("NOAA Caribbean Coral Data"),
leafletOutput("mymap"),
p(),
actionButton("laparguera", "La Parguera Data"),
actionButton("mona", "Mona Island Data"),
actionButton("isla", "Isla Catalina Data")
)
server <- function(input, output, session) {
output$mymap <- renderLeaflet({
leaflet() %>%
addTiles() %>%
addMarkers(lat = 17.95, lng = - 67.05, popup = "La Parguera ") %>%
addMarkers(lat = 18.00, lng = -67.50, popup = "Mona Island") %>%
addMarkers(lat = 18.2, lng = -69.00, popup = "Isla Catalina")
})
observeEvent(input$laparguera, {
DT::renderDataTable(DT::datatable(parguera)
})
}
shinyApp(ui, server)
Above is my code, trying to get the action button laparguera to display a dataframe. (Yes, I know it's plane data, not coral data, but I just want it to work first). Why is the action button not working?