| as_numeric | R Documentation |
as_numeric() converts a defined() vector to a numeric vector.
It validates that the underlying data are numeric, and optionally preserves
or strips semantic metadata.
as_numeric(x, ...)
## S3 method for class 'haven_labelled_defined'
as_numeric(x, strip_attributes = TRUE, ...)
x |
A vector created with |
... |
Reserved for future use. |
strip_attributes |
Logical; whether to remove semantic metadata
( |
Use strip_attributes = TRUE when flattening or preparing data for
external pipelines, but keep the default when working with defined
vectors directly.
as.numeric() drops all metadata and returns only the numeric values in
a vector.
A numeric vector with or without preserved attributes.
x <- defined(
1:3,
label = "Count",
unit = "n",
concept = "http://example.org/count",
namespace = "http://example.org/ns"
)
as_numeric(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.