#' @export
histogramUI <- function(id) {
tagList(
selectInput(NS(id, "var"), "Variable", names(mtcars)),
numericInput(NS(id, "bins"), "bins", 10, min = 1),
plotOutput(NS(id, "hist"))
)
}
#' @export
histogramServer <- function(id) {
moduleServer(id, function(input, output, session) {
data <- reactive(mtcars[[input$var]])
output$hist <- renderPlot({
hist(data(), breaks = input$bins, main = input$var)
}, res = 96)
})
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.