Last active
June 22, 2020 18:02
-
-
Save chasemc/ac8cdb72bb80e68328491bb448b595d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server <- function(input, output, server) { | |
output$out <- renderText({ | |
validate( | |
need(input$x < 0, "x can not be negative"), | |
need(input$trans %in% c("log", "square-root"), "trans blah blah") | |
) | |
switch(input$trans, | |
square = input$x ^ 2, | |
"square-root" = sqrt(input$x), | |
log = log(input$x) | |
) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment