Created
December 10, 2012 21:22
-
-
Save emhart/4253535 to your computer and use it in GitHub Desktop.
rOpenSci rgbif shiny app test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(ggplot2) | |
library(rgbif) | |
## Set up server output | |
shinyServer(function(input, output) { | |
# define function for server plot output | |
output$gbifplot <- reactivePlot(function() { | |
splist <- input$spec | |
out <- lapply(splist, function(x) occurrencelist(x, coordinatestatus =T, maxresults = 100)) | |
print(gbifmap(out)) | |
}) | |
output$cbt <- reactiveText(function(){ | |
}) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
# Define UI for application that plots random distributions | |
shinyUI(pageWithSidebar( | |
headerPanel("rgbif example"), | |
sidebarPanel( | |
checkboxGroupInput("spec", "Species to map:", | |
c('Sharp shinned hawk (Accipiter erythronemius)' = "Accipiter erythronemius", | |
"Dark eyed junco (Junco hyemalis)" = "Junco hyemalis", | |
"Wood duck (Aix sponsa)" = "Aix sponsa", | |
'Bald eagle (Haliaeetus leucocephalus)' = "Haliaeetus leucocephalus", | |
'Carrion crow (Corvus corone)' = "Corvus corone", | |
'Australian White Ibis (Threskiornis molucca)'= "Threskiornis molucca", | |
'Rosy Bee-eater (Merops malimbicus)' = 'Merops malimbicus' | |
), selected=c('Rosy Bee-eater (Merops malimbicus)','Carrion crow (Corvus corone)','Bald eagle (Haliaeetus leucocephalus)')) | |
), | |
mainPanel( | |
h5("A map of your selected species: Please note that Gbif is queried for every selection so loading times vary"), | |
plotOutput("gbifplot") | |
) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment