Skip to content

Instantly share code, notes, and snippets.

@mrchypark
Created July 13, 2018 01:23
Show Gist options
  • Save mrchypark/8514b5722018dbca2d78d6aced900e12 to your computer and use it in GitHub Desktop.
Save mrchypark/8514b5722018dbca2d78d6aced900e12 to your computer and use it in GitHub Desktop.
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