Skip to contents

Coerces numeric to decorated vector. Assigns class 'dvec' and any named attributes in dots.

Usage

# S3 method for class 'numeric'
as_dvec(x, ...)

Arguments

x

numeric

...

attributes to assign

Value

dvec

Examples

as_dvec(c(10.3, 1.2))
#> [1] 10.3  1.2
as_dvec(1, label = 'yin')
#> [1] 1
#> attr(,"label")
#> [1] "yin"
as_dvec(structure(1, label = 'yin'))
#> [1] 1
#> attr(,"label")
#> [1] "yin"
as_dvec(structure(1, label = 'yin'), label = 'yang')
#> [1] 1
#> attr(,"label")
#> [1] "yang"