\HeaderA{Quotes}{Quotes}{Quotes}
\aliasA{"}{Quotes}{"}
\aliasA{'}{Quotes}{'}
\aliasA{backquote}{Quotes}{backquote}
\aliasA{backtick}{Quotes}{backtick}
\aliasA{`}{Quotes}{`}
\keyword{documentation}{Quotes}
\begin{Description}\relax
Descriptions of the various uses of quoting in \R.
\end{Description}
\begin{Details}\relax
Three types of quote are part of the syntax of \R: single and double
quotation marks and the backtick (or back quote, \code{`}).  In
addition, backslash is used for quoting the following characters
inside character constants.
\end{Details}
\begin{Section}{Character constants}
Single and double quotes delimit character constants.  They can be used
interchangeably but double quotes are preferred (and character
constants are printed using double quotes), so single quotes are
normally only used to delimit character constants containing double
quotes.

Backslash is used to start an escape sequence inside character constants.
Unless specified in the following table, an escaped character is
interpreted as the character itself.  (Note that the parser will warn
about most such uses, as they are most often erroneous, e.g.
using \code{\bsl{}.} where \code{\bsl{}\bsl{}.} was intended.)

Single quotes need to be escaped by backslash in single-quoted
strings, and double quotes in double-quoted strings.

\Tabular{ll}{
\code{\bsl{}n}& newline\\
\code{\bsl{}r}& carriage return\\
\code{\bsl{}t}& tab\\
\code{\bsl{}b}& backspace\\
\code{\bsl{}a}& alert (bell)\\
\code{\bsl{}f}& form feed\\
\code{\bsl{}v}& vertical tab\\
\code{\bsl{}\bsl{}}& backslash \code{\bsl{}}\\
\code{\bsl{}nnn}& character with given octal code (1, 2 or 3 digits)\\
\code{\bsl{}xnn}& character with given hex code (1 or 2 hex digits)\\
\code{\bsl{}unnnn}& Unicode character with given code (1--4 hex digits)\\
\code{\bsl{}Unnnnnnnn}& Unicode character with given code (1--8 hex digits)\\
}
The last two are only supported on versions of \R{} built with MBCS
support, and the last is only supported in MBCS locales, and not on
Windows.  Alternative forms are \code{\bsl{}u\{nnnn\}} and
\code{\bsl{}U\{nnnnnnnn\}}.  (They are an error if used where not
supported.)  All except the Unicode escape sequences are also
supported when reading character strings by \code{\LinkA{scan}{scan}} and
\code{\LinkA{read.table}{read.table}} if \code{allowEscapes = TRUE}.

These forms will also be used by \code{\LinkA{print.default}{print.default}}
when outputting non-printable characters (including backslash).
\end{Section}
\begin{Section}{Names and Identifiers}
Identifiers consist of a sequence of letters, digits, the period
(\code{.}) and the underscore.  They must not start with a digit nor
underscore, nor with a period followed by a digit.

The definition of a \emph{letter} depends on the current locale, but
only ASCII digits are considered to be digits.

Such identifiers are also known as \emph{syntactic names} and may be used
directly in \R{} code.  Almost always, other names can be used
provided they are quoted.  The preferred quote is the backtick
(\code{`}), and \code{\LinkA{deparse}{deparse}} will normally use it, but under
many circumstances single or double quotes can be used (as a character
constant will often be converted to a name).  One place where
backticks may be essential is to delimit variable names in formulae:
see \code{\LinkA{formula}{formula}}.
\end{Section}
\begin{SeeAlso}\relax
\code{\LinkA{Syntax}{Syntax}} for other aspects of the syntax.

\code{\LinkA{sQuote}{sQuote}} for quoting English text.

\code{\LinkA{shQuote}{shQuote}} for quoting OS commands.

The \emph{R Language Definition} manual.
\end{SeeAlso}

