Hello everyone!
I apologize in advance that I have no real code to share despite just setting up a basic shiny template. I don't even know where to begin with this road block.
I need to enable my users to define an arbitrary number of conditions that will evaluate data and when evaluated will return a REJECTED status. Basically, I need to let them define a case_when in the front end so they can auto-reject data.
So the requirements to allow full functionality for a user to define conditions to a case_when they need to be able to;
- select a column to evaluate
- select an operator [ ==, !=, >=, <=, <, >]
- select a value to evaluate against
- Add as many AND and OR sections as needed.
And I have no idea how to approach this problem and after a fair amount of googling I cannot find the right key word search that returns anything useful.
Thank you in advance.
ui <-
dashboardPage(
dashboardHeader(title = "user defined case_when"),
dashboardSidebar(
sidebarMenu(
menuItem("mtcars", tabName = "mtcars", icon = icon("dashboard"))
)
),
###### Body content
dashboardBody(
tabItems(
tabItem(tabName = "mtcars",
fluidRow(
box(
textOutput("textOutput")
)
),
fluidRow(
box(width = 12,
DT::dataTableOutput("mtcars_2_DT")
)
)
)
)
)
)
server = function(input, output, session) {
output$textOutput <- renderText("user defined conditions here")
mtcars_2 <-
rownames_to_column(mtcars, "cars") %>%
mutate(evaluation_column = NA)
output$mtcars_2_DT <- DT::renderDataTable({
mtcars_2
})
}
shinyApp(ui, server)