Created
July 13, 2018 01:23
-
-
Save mrchypark/8514b5722018dbca2d78d6aced900e12 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
library(shiny) | |
library(lazyeval) | |
ui <- fluidPage( | |
titlePanel("text eval"), | |
sidebarLayout( | |
sidebarPanel( | |
textInput("text", | |
"formula:", | |
value = "") | |
), | |
mainPanel( | |
textOutput("result") | |
) | |
) | |
) | |
server <- function(input, output) { | |
formula <- reactive({ | |
ifelse(input$text != "", | |
lazyeval::lazy_eval(input$text), | |
"no text input" | |
) | |
}) | |
output$result <- renderText({ | |
formula() | |
}) | |
} | |
shinyApp(ui = ui, server = server) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment