currently I am trying to find a solution for executing chunks if the value(column name in table) from a textInput references to a numerical column in a given dataset.
I would like to check, if data[input$variable] is numerical. If True, the chunk should be executed.
I am using chunks in R Markdown and try to get an interactive shiny document.
R Markdown chunk options are evaluated as R code, so you can add conditional flows directly in the options to determine whether a chunk is executed depending on whether the statement evaluates to TRUE or FALSE.
```{r eval=is.numeric(data[input$variable])}
# some code to possibly evaluate...
```
thank you for the quick answer. Unfortunately I already tried this, but I still get the error:
"Can't access reactive value "variable" outside of reactive consumer."
Hope, someone already had the same issue and can provide me a solution for this.