Options for Expression Deparsing
Process the deparsing options for
character vector of deparsing options.
control argument is a vector containing zero or more of the
following strings. Partial string matching is used.
Either surround integer vectors by
as.integer()or use suffix
L, so they are not converted to type double when parsed. This includes making sure that integer
NAs are preserved (via
NA_integer_if there are no non-
NAvalues in the vector, unless
Surround expressions with
quote(), so they are not evaluated when re-parsed.
If the object has a
sourceattribute, display that instead of deparsing the object. Currently only applies to function definitions.
Some exotic objects such as environments, external pointers, etc. can not be deparsed properly. This option causes a warning to be issued if the deparser recognizes one of these situations.
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.
Integer, real and character
NAs are surrounded by coercion functions where necessary to ensure that they are parsed to the same type. Since e.g.
NA_real_can be output in R, this is mainly used in connection with
An abbreviated way to specify all of the options listed above. This is the default for
dump, and the options used by
edit(which are fixed).
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.
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. Backticks are not used.
Real and finite complex numbers are output in "%a" format as binary fractions (coded as hexadecimal: see
sprintf) with maximal opportunity to be recorded exactly to full precision. Complex numbers with one or both non-finite components are output as if this option were not set.
(This relies on that format being correctly supported: known problems on Windows are worked around as from R 3.1.2.)
Real and finite complex numbers are output using format "%.17g" which may give more precision than the default (but the output will depend on the platform and there may be loss of precision when read back). Complex numbers with one or both non-finite components are output as if this option were not set.
For the most readable (but perhaps incomplete) display, use
control = NULL. This displays the object's value, but not its
attributes. The default in
deparse is to display the
attributes as well, but not to use any of the other options to make
the result parseable. (
use more default options, and printing of functions without sources
control = c("all", "hexNumeric") comes closest to making
deparse() an inverse of
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. Also, representing double and complex numbers as decimals
may well not be exact.
Only one of
"digits17" can be specified.
A numerical value corresponding to the options selected.