shinyServer( function(input, output) { output$data <- renderUI({ #Make the Hurricane data frame #Note: Data could be imported from external sources instead name <- c("Abigail", "Barney", "Clodagh", "Desmond") date_of_impact <- as.Date(c('2015-11-12', '2015-11-17', '2015-11-29', '2015-12-04')) highest_gust_mph <- c(84, 85, 97, 81) power_outages <- c(20000, 26000, 16000, 46300) hurricanes <- data.frame(name, date_of_impact, highest_gust_mph, power_outages) switch(input$name, "Abigail" = {row <- 1}, "Barney" = {row <- 2}, "Clodagh" = {row <- 3}, "Desmond" = {row <- 4}) HTML( paste0("Name: ", input$name, '<br>', "Date of Impact: ", hurricanes[row,2], '<br>', "Highest Gust (MPH): ", hurricanes[row,3], '<br>', "Power Outages: ", hurricanes[row,4], '<br>' ) ) }) } )