Skip to content

Instantly share code, notes, and snippets.

@sahooa

sahooa/server.R Secret

Last active February 5, 2017 04:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sahooa/9031b2eb5d75e57ea301b954dcb5c19d to your computer and use it in GitHub Desktop.
Save sahooa/9031b2eb5d75e57ea301b954dcb5c19d to your computer and use it in GitHub Desktop.
First Shiny NYCSD project
shinyServer(function(input, output){
dataInput1 <- reactive({
cor(empl %>%
filter (region == input$in1) %>%
select (empl,gdp,population,avg_temp,co2),method="pearson",use ="na.or.complete")
})
output$plot1 <- renderPlot({
corrplot(dataInput1(), method = input$param1)
})
dataInput2 <- reactive({
cor(empl %>%
filter (country == input$in2) %>%
select (empl,gdp,population,avg_temp,co2),method="pearson",use ="na.or.complete")
})
output$plot2 <- renderPlot({
corrplot(dataInput2(), method = input$param2)
})
output$gvis <- renderGvis({
gvisMotionChart(empl,
idvar = "country",
timevar = "year",
xvar = "gdp",
yvar = "empl",
sizevar ="population",
colorvar = "region",
options=list(width="1000px", height="600px"))
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment