Rev 46828 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/base/man/Quotes.Rd% Part of the R package, http://www.R-project.org% Copyright 1995-2008 R Core Development Team% Distributed under GPL 2 or later\name{Quotes}\alias{Quotes}\alias{backtick}\alias{backquote}\alias{'}%'\alias{"}%"\alias{`}%`\concept{quotes}\concept{backslash}\title{Quotes}\description{Descriptions of the various uses of quoting in \R.}\details{Three types of quote are part of the syntax of \R: single and doublequotation marks and the backtick (or back quote, \samp{`}). Inaddition, backslash is used for quoting the following charactersinside character constants.}\section{Character constants}{Single and double quotes delimit character constants. They can be usedinterchangeably but double quotes are preferred (and characterconstants are printed using double quotes), so single quotes arenormally only used to delimit character constants containing doublequotes.Backslash is used to start an escape sequence inside character constants.Unless specified in the following table, an escaped character isinterpreted as the character itself. (Note that the parser will warnabout most such uses, as they are most often erroneous, e.g.using \samp{\.} where \samp{\\\\.} was intended.)Single quotes need to be escaped by backslash in single-quotedstrings, and double quotes in double-quoted strings.\tabular{ll}{\samp{\n}\tab newline\cr\samp{\r}\tab carriage return\cr\samp{\t}\tab tab\cr\samp{\b}\tab backspace\cr\samp{\a}\tab alert (bell)\cr\samp{\f}\tab form feed\cr\samp{\v}\tab vertical tab\cr\samp{\ }\tab backslash \samp{\ }\cr\samp{\nnn}\tab character with given octal code (1, 2 or 3 digits)\cr\samp{\xnn}\tab character with given hex code (1 or 2 hex digits)\cr\samp{\unnnn}\tab Unicode character with given code (1--4 hex digits)\cr\samp{\Unnnnnnnn}\tab Unicode character with given code (1--8 hex digits)\cr}The last two are only supported on versions of \R built with MBCSsupport: they are an error on other versions. Alternative forms are\samp{\u{nnnn}} and \samp{\U{nnnnnnnn}}. All except the Unicodeescape sequences are also supported when reading character strings by\code{\link{scan}} and \code{\link{read.table}} if\code{allowEscapes = TRUE}.These forms will also be used by \code{\link{print.default}}when outputting non-printable characters (including backslash).<<<<<<< .workingNote that as from \R 2.8.0 embedded nuls are not allowed in characterstrings, so using escapes (such as \samp{\0}) for a nul will resultin the string being truncated at that point (usually with a warning).=======Embedded nuls are not allowed in character strings, so using escapes(such as \code{\\0}) for a nul will result in the string beingtruncated at that point (usually with a warning).>>>>>>> .merge-right.r46902}\section{Names and Identifiers}{Identifiers consist of a sequence of letters, digits, the period(\samp{.}) and the underscore. They must not start with a digit norunderscore, nor with a period followed by a digit.The definition of a \emph{letter} depends on the current locale, butonly ASCII digits are considered to be digits.Such identifiers are also known as \emph{syntactic names} and may be useddirectly in \R code. Almost always, other names can be usedprovided they are quoted. The preferred quote is the backtick(\samp{`}), and \code{\link{deparse}} will normally use it, but undermany circumstances single or double quotes can be used (as a characterconstant will often be converted to a name). One place wherebackticks may be essential is to delimit variable names in formulae:see \code{\link{formula}}.}\seealso{\code{\link{Syntax}} for other aspects of the syntax.\code{\link{sQuote}} for quoting English text.\code{\link{shQuote}} for quoting OS commands.The \emph{R Language Definition} manual.}\keyword{documentation}