Yess of course that's possible. ShinyR provides a function called radioButtons.
syntax:
radioButtons(inputId, label, choices, selected = NULL, inline = FALSE,
width = NULL)
Example:
ui <- fluidPage(
radioButtons("dist", "Distribution type:", c("Normal" = "norm", "Uniform" = "unif", "Log-normal" = "lnorm", "Exponential" = "exp")),
plotOutput("distPlot")
)
server <- function(input, output) {
output$distPlot <- renderPlot({ dist <- switch(input$dist, norm = rnorm, unif = runif, lnorm = rlnorm, exp = rexp, rnorm)
hist(dist(500))
})
}