deparse
, dput
and
dump
.
.deparseOpts(control)
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
as.integer()
or use
suffix L
, so they are not converted to type double when
parsed. This includes making sure that integer NA
s are
preserved (via NA_integer_
if there are no non-NA
values in the vector, unless "S_compatible"
is set).
quoteExpressions
quote()
, so they are not
evaluated when re-parsed.
showAttributes
source
attribute), use structure()
to display them as well as the
object value. This is the default for deparse
and
dput
.
useSource
source
attribute, display that instead
of deparsing the object. Currently only applies to function
definitions.
warnIncomplete
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.
keepNA
NA
s are surrounded by coercion
functions where necessary to ensure that they are parsed to the
same type. Since e.g.\ifelse{latex}{\out{~}}{ } NA_real_
can be output in R, this is
mainly used in connection with S_compatible
.
all
dump
, and the options
used by edit
(which are fixed).
delayPromises
S_compatible
hexNumeric
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.)
digits17
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. (dput
and dump
do
use more default options, and printing of functions without sources
uses c("keepInteger", "keepNA")
.)
Using 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 "hexNumeric"
and "digits17"
can be specified.