knitr error with pipe symbol

Hello, I am fairly new to R programming and I am trying to knit my code. However, I keep getting errors with "could not find function" "%% error." I looked it up online and some people suggested deleting the install package line, which I complied with. But it is still not working. Can you guys take a look? Thanks

Here is the code that the error is suggesting

calories <- calories %>%
rename(Date=ActivityDay)
sleep <- sleep %>%
rename(Date=SleepDay)

We need a reproducible example (reprex)

You have loaded tidyverse?