by rcthompson · 11y ago · 0 comments
The article is being a little unclear when it says "cannot use". You can use literally any variable name in R if you really want to. If the name you want is already a reserved word (e.g. "for", "else", "function"), or if it is not a syntactically valid token (e.g. '@!":%$>"@;'), then you just have to enclose it in backquotes. So the following is valid R:
`for` <- 1:5
`function` <- 5:1
`TRUE` <- `for` / `function`
`@!":%$>"@;` <- `TRUE`^2
print(`@!":%$>"@;`)