A list_of object is a list where each element has the same type.
Modifying the list with $, [, and [[ preserves the constraint
by coercing all input items.
Usage
list_of(..., .ptype = NULL)
as_list_of(x, ...)
is_list_of(x)
# S3 method for vctrs_list_of
vec_type2(x, y)
# S3 method for vctrs_list_of
vec_cast(x, to)
Arguments
...
Vectors to coerce.
.ptype
If NULL, the default, the output type is determined by
computing the common type across all elements of ....
Alternatively, you can supply .ptype to give the output known type.
If getOption("vctrs.no_guessing") is TRUE you must supply this value:
this is a convenient way to make production code demand fixed types.
x
For as_list_of(), a vector to be coerced to list_of.