'Unable to knit to HTML due to error "No applicable method for filter applied to an object of class

I have finished my code and it all runs well in Rmarkdown - however when I attempt to knit to html I receive an error

Error image

Data link - kaggle page

Any ideas on what m missing?

library(dplyr)
library(tidyverse)
library(readr)
library(ggplot2)
library(magrittr)
library(colourpicker)


```{r}
str(menu)
head(menu)
dim(menu)

#Filter outliers outside of 15 & 1151
menu2 <- menu %>% 
  filter(between(Calories, 15, 1151))

#Group together food categories
Category_groups <- menu2 %>% 
  group_by(Category) %>%
  summarise(mean = mean(Calories))
Category_groups

#Add column to categorise high, med, low calories
Category_groups$Cal_group <- factor(c('HIGH', 'LOW', 'HIGH', 'HIGH', 'MEDIUM', 'MEDIUM', 'MEDIUM', 'HIGH', 'MEDIUM'))
```


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source