This seems to be a bug when I open a script that uses "" instead of "function" and "|>" instead of "%>%".
I have the latest version of R installed, so it doesn't seem to be a matter of updating.
Here is the example, and when I hover over the red circular x's it says, "unexpected token '>'":
When I try to run the script, it seems to recognize these symbols and there are no errors. It just seems like some sort of bug where it's flagging these unexpected symbols but when running they are recognized. Not sure how to fix this bug? Or if it's just a matter of redownloading RStudio?