Skip to contents

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.

Usage

# S3 method for class 'haven_labelled_defined'
vec_cast.double(x, to, ...)

Arguments

x

haven_labelled_defined vector (created by defined()).

to

Target type (must be double()).

...

Ignored; reserved for future use.

Value

A plain numeric (double) vector.

Examples

x <- defined(c(10, 20), unit = "kg")
vctrs::vec_cast(x, double())
#> [1] 10 20
as.numeric(x)
#> [1] 10 20