if (interactive()) {
# Single selection
color <- menu(c("Red", "Green", "Blue"), prompt = "Pick a color:")
# Multiple selection
toppings <- menu(
c("Pepperoni", "Mushrooms", "Olives"),
type = "checkbox",
prompt = "Select toppings:"
)
}
Run the code above in your browser using DataLab