Here are the rules for what identifiers can be named in R. It says:
Identifiers consist of a sequence of letters, digits, the period (‘.’) and the underscore. They must not start with a digit or an underscore, or with a period followed by a digit.
But it seems possible to assign variables that do not meet these rules simply by using quotes around the illegal identifier name
E.g. Using an illegal character in an identifier name (in this case, a space)
`sdf sdf` <- 2
`sdf sdf`
# [1] 2
A question mark also works
`sdf?sdf` <- 2
`sdf?sdf`
# [1] 2
Varibles assigned in this way seem to work
`_sdfk` <- 2
`_sdfk` * 9
# [1] 18
It even works for functions
"my funct" <- function(x) { x * 2 }
"my funct"(3)
# [1] 6
According to the rules, these identifiers should not be possible.
Why is R allowing this?