
Cast defined vector to base numeric (double)
Source:R/as_numeric.R
vec_cast.double.haven_labelled_defined.Rd
S3 method for vctrs::vec_cast()
that converts a
haven_labelled_defined
vector (created by defined()
) to a base
numeric
(double) vector, dropping all semantic metadata.
Examples
x <- defined(c(10, 20), unit = "kg")
vctrs::vec_cast(x, double())
#> [1] 10 20
as.numeric(x)
#> [1] 10 20