Skip to content

Instantly share code, notes, and snippets.

@ramnathv
Created February 2, 2014 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ramnathv/76c98dde2e4c87073239 to your computer and use it in GitHub Desktop.
Save ramnathv/76c98dde2e4c87073239 to your computer and use it in GitHub Desktop.
library(shiny)
runApp(list(
ui = bootstrapPage(
uiOutput('intext'),
uiOutput('variables')
),
server = function(input, output){
outVar <- reactive({
mytext = input$text
if (!is.null(mytext)){
vars <- all.vars(parse(text = mytext))
vars <- as.list(vars)
return(vars)
}
})
output$intext = renderUI({
textInput("text", "Enter Formula", "a=b+c")
})
output$variables = renderUI({
selectInput('variables2', 'Variables', outVar())
})
}
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment