Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

vec_list_cast

Cast a list to vector of specific type


Description

This is a function for developers to use when extending vctrs. It casts a list to a more specific vectoring type, keeping the length constant. It does this by discarding (with a warning), any elements after the 1. It is called from vec_cast.XYZ.list() methods to preserve symmetry with vec_cast.list.XYZ().

Usage

vec_list_cast(x, to, ..., x_arg = "", to_arg = "")

Arguments

x

A list

to

Type to coerce to

...

These dots are for future extensions and must be empty.

Details

See vignette("s3-vector") for details.


vctrs

Vector Helpers

v0.3.8
MIT + file LICENSE
Authors
Hadley Wickham [aut], Lionel Henry [aut, cre], Davis Vaughan [aut], data.table team [cph] (Radix sort based on data.table's forder() and their contribution to R's order()), RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.