I'm creating a visualization in Shiny based on the 'movies' dataset. In the dataset, among others, for each movie there is an attribute plot_keywords (format is murder|crime|police|man|detective - 5 words separated with | without spaces). I want to implement an interactive filter for this attribute regardless of uppercase / capital letters - that is, when you enter 'Murder', for example, Shiny should display all movies where 'murder' is present at any part of the plot_keywords attribute. In my code, if the user does not enter anything in the filter box (by default), all movies are displayed. What function should I use after 'else'?
Part of UI code
ui <- fluidPage(
fluidRow(
column(3,
wellPanel(
textInput("plot", "I want to watch movie about...",NULL)
)),
Part of Server code
server <- function(input, output) {
p <- input$plot
m <- movies %>%
filter(
if(p != NULL) && (p != "")
{plot_keywords == movies$plot_keywords}
else
)`