Closed emantzo closed 4 years ago
Yes, I think so, please see the prototype below:
library(shiny)
library(shinyjqui)
ui <- fluidPage(
orderInput("ops", "Operators", c("~", "+", "*"),
as_source = T, connect = "formula",
item_class = "default"),
orderInput("var", "Variables", c("x", "y", "z"),
as_source = F, connect = "formula",
item_class = "primary",
placeholder = "(blank)"),
orderInput("formula", "Formula", items = NULL,
as_source = F, connect = NULL, placeholder = "(build your formula)"),
verbatimTextOutput("myFormula")
)
server <- function(input, output, session) {
output$myFormula <- renderPrint({
paste0(input$formula, collapse = " ")
})
}
shinyApp(ui, server)
Awesome-- thanks a million!
Hi, I was wondering if I could use this package in shiny to allow the user to define a custom formula based on pre-defined variables (contained eg in an "orderInput")?
Many thanks for your time!