Hacker News new | past | comments | ask | show | jobs | submit login

Yes, all those single-letter names are just ordinary variables that you can overwrite. Doing so is nearly always a terrible idea.

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(`@!":%$>"@;`)



and if you overwrite variables like "c", you can always invoke the original concatenation function as "base::c".




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: