[ RDocumentation ](/)

Moon  [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)

Search all packages and functions

[ base  (version  3.6.2  ) ](/packages/base/versions/3.6.2)

#  deparseOpts: Options for Expression Deparsing

##  Description

Process the deparsing options for ` deparse ` , ` dput ` and ` dump ` .

##  Usage

    
    
    .deparseOpts(control)
    
    ..deparseOpts

##  Arguments

control

character vector of deparsing options.

##  Value

An integer value corresponding to the ` control ` options selected.

##  Details

` ..deparseOpts ` is the ` [ character
](/link/character?package=base&version=3.6.2) ` vector of possible deparsing
options used by ` .deparseOpts() ` .

` .deparseOpts() ` is called by ` [ deparse
](/link/deparse?package=base&version=3.6.2) ` , ` [ dput
](/link/dput?package=base&version=3.6.2) ` and ` [ dump
](/link/dump?package=base&version=3.6.2) ` to process their ` control `
argument.

The ` control ` argument is a vector containing zero or more of the following
strings (exactly those in ` ..deparseOpts ` ). Partial string matching is
used.

` "keepInteger" ` :

    

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 ` NA ` s are preserved (via ` NA_integer_ ` if there are no non-
` NA ` values in the vector, unless ` "S_compatible" ` is set).

` "quoteExpressions" ` :

    

Surround unevaluated expressions, but not ` [ formula
](/link/formula?package=base&version=3.6.2) ` s, with ` quote() ` , so they
are not evaluated when re-parsed.

` "showAttributes" ` :

    

If the object has ` [ attributes
](/link/attributes?package=base&version=3.6.2) ` (other than a ` source `
attribute, see ` [ srcref ](/link/srcref?package=base&version=3.6.2) ` ), use
` [ structure ](/link/structure?package=base&version=3.6.2) () ` to display
them as well as the object value unless the only such attribute is ` names `
and the ` "niceNames" ` option is set. This ( ` "showAttributes" ` ) is the
default for ` [ deparse ](/link/deparse?package=base&version=3.6.2) ` and ` [
dput ](/link/dput?package=base&version=3.6.2) ` .

` "useSource" ` :

    

If the object has a ` source ` attribute ( ` [ srcref
](/link/srcref?package=base&version=3.6.2) ` ), display that instead of
deparsing the object. Currently only applies to function definitions.

` "warnIncomplete" ` :

    

Some exotic objects such as [ environment
](/link/environment?package=base&version=3.6.2) s, 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.

` "keepNA" ` :

    

Integer, real and character ` NA ` s 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 `
S_compatible ` .

` "niceNames" ` :

    

If true, ` [ list ](/link/list?package=base&version=3.6.2) ` s and atomic
vectors with non- ` [ NA ](/link/NA?package=base&version=3.6.2) ` names (see `
[ names ](/link/names?package=base&version=3.6.2) ` ) are deparsed as e.g., `
c(A = 1) ` instead of ` structure(1, .Names = "A") ` , independently of the `
"showAttributes" ` setting.

` "all" ` :

    

An abbreviated way to specify all of the options listed above. This is the
default for ` dump ` , and the options used by ` [ edit
](/link/edit?package=base&version=3.6.2) ` (which are fixed).

` "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.

` "S_compatible" ` :

    

Make deparsing as far as possible compatible with