I have an R Shiny app like this:
library(shiny)
library(DT)
# Example data
data <- data.frame(col1 = c("syncope", "fall", "dizziness", "headache", "back pain"),
col2 = c(1, 2, 3, 4, 5))
# Shiny app
ui <- fluidPage(
DT::dataTableOutput("mytable")
)
server <- function(input, output) {
output$mytable <- DT::renderDataTable({
DT::datatable(data, filter = 'top',options = list(search = list(regex = TRUE)))
})
}
shinyApp(ui, server)
I was able to code it to this way to allow filtering with multiple conditions, thanks to this question. However, Regex isn't really that intuitive. Someone would have to enter sync|dizz to filter down to the rows that show syncope and dizziness. Or p[ae] to filter on back pain and syncope.
Is it possible to code things in such a way that you could separate 2 strings with a space, or with the word 'OR', to achieve this instead? For instance, you could enter sync dizz, or maybe sync OR dizz. This would be more intuitive for users.
Please note that I am referring to the search boxes that are above each column (blue arrow), not the general Search box that was referred to in a similar question (red arrow).