These options will be used on objects of type 'list'.
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- trim
NULL
or integerish. Maximum of elements showed before it's trimmed. Note that it will necessarily produce code that doesn't reproduce the input. This code will parse without failure but its evaluation might fail.- fill
String. Method to use to represent the trimmed elements.
Details
Depending on constructor
, we construct the object as follows:
"list"
(default): Build the object by callinglist()
."list2"
: Build the object by callingrlang::list2()
, the only difference with the above is that we keep a trailing comma when the list is not trimmed and the call spans several lines.
If trim
is provided, depending on fill
we will present trimmed elements as followed:
"vector"
(default): Usevector()
, so for instancelist("a", "b", "c")
might becomec(list("a"), vector("list", 2))
."new_list"
: Userlang::new_list()
, so for instancelist("a", "b", "c")
might becomec(list("a"), rlang::new_list(2))
."+"
: Use unary+
, so for instancelist("a", "b", "c")
might becomelist("a", +2)
."..."
: Use...
, so for instancelist("a", "b", "c")
might becomelist("a", ...)
"none"
: Don't represent trimmed elements.
When trim
is used the output is parsable but might not be possible to evaluate,
especially with fill = "..."
. In that case you might want to set check = FALSE