factor_conversion: Convert factor with numeric labels into numeric vector

f.as.numericR Documentation

Convert factor with numeric labels into numeric vector

Description

Convert factor with numeric labels into numeric vector

Usage

f.as.numeric(x)

Arguments

x

a factor with numeric labels

Author(s)

Ulrike Grömping, groemping@beuth-hochschule.de

Ben Wiseman, benjamin.wiseman@kornferry.com

Examples


 x <- factor(c(11, 22, 33, 99))
 as.numeric(x)
 # 1 2 3 4   # NOT typically the desired.expected output

 f.as.numeric(x)
 # 11 22 33 99  # Typically desired output

 # Or...
 as.numeric(as.character(x)) # A tad unsightly


roperators documentation built on July 26, 2023, 5:27 p.m.