| list_of {vctrs} | R Documentation |
list_of S3 class for homogenous listsA 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.
list_of(..., .ptype = NULL) as_list_of(x, ...) is_list_of(x) ## S3 method for class 'vctrs_list_of' vec_type2(x, y) ## S3 method for class 'vctrs_list_of' vec_cast(x, to)
... |
Vectors to coerce. |
.ptype |
If Alternatively, you can supply |
x |
For |
y, to |
Arguments to |
x <- list_of(1:3, 5:6, 10:15)
if (requireNamespace("tibble", quietly = TRUE)) {
tibble::tibble(x = x)
}
vec_c(list_of(1, 2), list_of(FALSE, TRUE))