validate_one_row_per_id | R Documentation |
validate_one_row_per_id(x, key = c("USUBJID", "STUDYID"))
x |
( |
key |
( |
This function is a wrapper for shiny::validate
.
iris$id <- rep(1:50, times = 3)
ui <- fluidPage(
selectInput(
inputId = "species",
label = "Select species",
choices = c("setosa", "versicolor", "virginica"),
selected = "setosa",
multiple = TRUE
),
plotOutput("plot")
)
server <- function(input, output) {
output$plot <- renderPlot({
iris_f <- iris[iris$Species %in% input$species, ]
validate_one_row_per_id(iris_f, key = c("id"))
hist(iris_f$Sepal.Length, breaks = 5)
})
}
if (interactive()) {
shinyApp(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.