You cannot make something "naked" like ?foo without messing with the C code defining the R syntax. For example, you cannot make [fnord meaningful.
This comes from the definition of the syntax in gram .y in R. sources
| '~' expr %prec TILDE { $$ = xxunary($1,$2); } | '?' expr { $$ = xxunary($1,$2); } | expr ':' expr { $$ = xxbinary($2,$1,$3); } | expr '+' expr { $$ = xxbinary($2,$1,$3); }
The second line above defines the syntax ?foo . What exactly are you trying to do?
source share