#' Shiny app
#'
#' @importFrom shiny fluidPage verbatimTextOutput
#' @importFrom shinyWidgets searchInput
ui<-shiny::fluidPage(
# Title
shiny::titlePanel("Find the current weather in your city!"),
shinyWidgets::searchInput(inputId="city",
label="Enter city",
placeholder = "Linkoping",
btnSearch = shiny::icon("search"),
btnReset = shiny::icon("remove"),
width = "450px"),
shiny::verbatimTextOutput(outputId = "res"),
shiny::plotOutput("plot",width = "50%")
)
#' Server function
#'
#' @importFrom shiny renderPrint
#' @export
server<-function(input,output,session){
output$res <- shiny::renderPrint({
weather(input$city)
})
output$plot <- shiny::renderPlot({
plot(weather(input$city))
})
}
shiny::shinyApp(ui=ui,server=server)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.