opts_function {constructive}R Documentation

Constructive options for functions

Description

These options will be used on functions, i.e. objects of type "closure", "special" and "builtin".

Usage

opts_function(
  constructor = c("function", "as.function", "new_function"),
  ...,
  environment = TRUE,
  srcref = FALSE,
  trim = NULL
)

Arguments

constructor

String. Name of the function used to construct the object, see Details section.

...

Additional options used by user defined constructors through the opts object

environment

Boolean. Whether to reconstruct the function's environment.

srcref

Boolean. Whether to attempt to reconstruct the function's srcref.

trim

NULL or integerish. Maximum of lines showed in the body before it's trimmed, replacing code with .... Note that it will necessarily produce code that doesn't reproduce the input, but it will parse and evaluate without failure.

Details

Depending on constructor, we construct the object as follows:

Value

An object of class <constructive_options/constructive_options_function>


[Package constructive version 1.0.1 Index]