I am trying to develop a dashboard with flexdashboard
. However, dplyr
somehow does not work in the chunk and gives an error.
My code:
Total = data %>% dplyr::filter(CONDITION == 'A') %>% nrow()
valueBox(value = Total ,icon = "fa-user-plus",caption = "Total",color = "green")
Error in UseMethod("filter_") : no applicable method for 'filter_' applied to an object of class
"function" Calls: <Anonymous> ... <Anonymous> -> <Anonymous> -> filter.default -> filter_
In addition: Warning messages:
1: package 'flexdashboard' was built under R version 3.6.3
2: package 'dplyr' was built under R version 3.6.1
Execution halted`
What I have tried: 1.
- Updating
dplyr
- Updating
tidyverse
- Updating 'R'
- Printing the value directly (but as I wan to automate, I would need the code to work)