When passing arguments to R scripts from the command line, single and double quotes behave differently due to shell rules. Single quotes treat all characters literally, while double quotes allow escape sequences and variable expansion. Inside the R console or scripts, backslashes must be doubled to represent a literal backslash. When running Rscript with command-line arguments, the shell's quoting rules apply before R processes the string, so a single-quoted '\+hello' and a double-quoted '\\+hello' both deliver the same string to R.
Sort: