Syntactically invalid names need to be wrapped in backticks (`…`) to be used in code. This includes operators when using them as regular R names rather than infix operators. This is the case when you want to define them:
`%|%` <- function(a, b) a + b
It’s also the case when you want to pass them into a higher-order function such as sapply:
sapply(1 : 5, `-`)
# [1] -1 -2 -3 -4 -5
(Of course this particular example is pretty useless since most operators are vectorised so you could just write - (1 : 5) instead of the above.)
You might also see code that uses quotes instead of backticks but this is discouraged.