| deparseOpts {base} | R Documentation |
Options for Expression Deparsing
Description
Process the deparsing options for deparse, dput and
dump.
Usage
.deparseOpts(control)
Arguments
control |
character vector of deparsing options. |
Details
This is called by deparse, dput and
dump to process their control argument.
The control argument is a vector containing zero or more of the
following strings. Partial string matching is used.
keepInteger-
Surround integer vectors by
as.integer(), so they are not converted to floating point when re-parsed. quoteExpressions-
Surround expressions with
quote(), so they are not evaluated when re-parsed. showAttributes-
If the object has attributes (other than a
sourceattribute), usestructure()to display them as well as the object value. This is the default fordeparseanddput. useSource-
If the object has a
sourceattribute, display that instead of deparsing the object. Currently only applies to function definitions. warnIncomplete-
Some exotic objects such as environments, external pointers, etc. can not be deparsed properly. This option causes a warning to be issued if any of those may give problems.
all-
An abbreviated way to specify all of the options listed above. May not be used with other options. This is the default for
dump. 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.
For the most readable (but perhaps incomplete) display, use
control = NULL. This displays the object's value, but not its
attributes. The default is to display the attributes as well, but
not to use any of the other options to make the result parseable.
Using control = "all" comes closest to making deparse()
an inverse of parse(). However, not all objects are
deparseable even with this option. A warning will be issued if the
function recognizes that it is being asked to do the impossible.
Value
A numerical value corresponding to the options selected.