\HeaderA{deparseOpts}{Options for Expression Deparsing}{deparseOpts}
\aliasA{.deparseOpts}{deparseOpts}{.deparseOpts}
\keyword{programming}{deparseOpts}
\begin{Description}\relax
Process the deparsing options for \code{deparse}, \code{dput} and
\code{dump}.
\end{Description}
\begin{Usage}
\begin{verbatim}
.deparseOpts(control)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{control}] character vector of deparsing options.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This is called by \code{\LinkA{deparse}{deparse}}, \code{\LinkA{dput}{dput}} and
\code{\LinkA{dump}{dump}} to process their \code{control} argument.

The \code{control} argument is a vector containing zero or more of the
following strings.  Partial string matching is used.
\describe{
\item[\code{keepInteger}] Either surround integer vectors by \code{as.integer()} or use
suffix \code{L}, so they are not converted to type double when
parsed.  This includes making sure that integer \code{NA}s are
preserved (via \code{NA\_integer\_} if there are no non-\code{NA}
values in the vector, unless \code{"S\_compatible"} is set).

\item[\code{quoteExpressions}] Surround expressions with \code{quote()}, so they are not
evaluated when re-parsed.

\item[\code{showAttributes}] If the object has attributes (other than a \code{source}
attribute), use \code{structure()} to display them as well as the
object value.  This is the default for \code{\LinkA{deparse}{deparse}} and
\code{\LinkA{dput}{dput}}.

\item[\code{useSource}] If the object has a \code{source} attribute, display that instead
of deparsing the object.  Currently only applies to function
definitions.

\item[\code{warnIncomplete}] Some exotic objects such as \LinkA{environment}{environment}s,
external pointers, etc. can not be deparsed properly.  This option
causes a warning to be issued if any of those may give problems.

Also, the parser in \R{} < 2.7.0 would only accept strings of up to
8192 bytes, and this option gives a warning for longer strings.

\item[\code{keepNA}] Integer, real and character \code{NA}s are surrounded by coercion
where necessary to ensure that they are parsed to the same type.

\item[\code{all}] An abbreviated way to specify all of the options
listed above.  This is the default for \code{dump}, and the options
used by \code{\LinkA{edit}{edit}} (which are fixed).

\item[\code{delayPromises}] Deparse promises in the form <promise: expression> rather than
evaluating them.  The value and the environment of the promise
will not be shown and the deparsed code cannot be sourced.

\item[\code{S\_compatible}] Make deparsing as far as possible compatible with S and \R{} < 2.5.0.
For compatibility with S, integer values of double vectors are
deparsed with a trailing decimal point.

}
For the most readable (but perhaps incomplete) display, use
\code{control = NULL}. This displays the object's value, but not its
attributes.  The default in \code{\LinkA{deparse}{deparse}} is to display the
attributes as well, but not to use any of the other options to make
the result parseable.  (\code{\LinkA{dput}{dput}} and \code{\LinkA{dump}{dump}} do
use more default options, and printing of functions without sources
uses \code{c("keepInteger", "keepNA")}.)

Using \code{control = "all"} comes closest to making \code{deparse()}
an inverse of \code{parse()}.  However, not all objects are
deparse-able even with this option.  A warning will be issued if the
function recognizes that it is being asked to do the impossible.
\end{Details}
\begin{Value}
A numerical value corresponding to the options selected.
\end{Value}

