-
-
Save ramnathv/76c98dde2e4c87073239 to your computer and use it in GitHub Desktop.
This file contains 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) | |
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