Skip to content

Instantly share code, notes, and snippets.

@karthik
Created December 10, 2012 22:57
Show Gist options
  • Save karthik/4254106 to your computer and use it in GitHub Desktop.
Save karthik/4254106 to your computer and use it in GitHub Desktop.
rgif data test
library(shiny)
library(ggplot2)
library(rgbif)
## Set up server output
load('/home/karthik/ShinyApps/rgbif/results.rda')
shinyServer(function(input, output) {
# define function for server plot output
output$gbifplot <- reactivePlot(function() {
print(gbifmap(results[input$spec]))
})
output$cbt <- reactiveText(function(){
})
})
library(shiny)
# Define UI for application that plots random distributions
shinyUI(pageWithSidebar(
headerPanel("Maps via rgbif"),
sidebarPanel(
checkboxGroupInput("spec", "Species to map:",
c('Sharp shinned hawk (Accipiter erythronemius)' = "1",
"Dark eyed junco (Junco hyemalis)" = "2",
"Wood duck (Aix sponsa)" = "3",
'Bald eagle (Haliaeetus leucocephalus)' = "4",
'Carrion crow (Corvus corone)' = "5",
'Australian White Ibis (Threskiornis molucca)' = "6",
'Rosy Bee-eater (Merops malimbicus)' = '7'
), selected=c('Rosy Bee-eater (Merops malimbicus)'))
),
mainPanel(
h2("Species Distribution Map"),
plotOutput("gbifplot")
)
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment