Skip to contents

In terms of the numeric values it's the same as running as.numeric(x), but it makes the result a labelled numeric by attaching "labels" attribute where i-th level of the original factor goes as the label for integer i.

Usage

fct_as_labelled(x)

Arguments

x

a factor

Examples

fct_as_labelled(factor(c("a", "b", "c")))
#> <labelled<double>[3]>
#> [1] 1 2 3
#> 
#> Labels:
#>  value label
#>      1     a
#>      2     b
#>      3     c