Learn R Programming

icd9 (version 0.2.1)

asNumericNoWarn: convert factor or vector to numeric without warnings

Description

correctly converts factors to vectors, and then converts to numeric or integer, which may silently introduce NAs. Invisible rounding errors can be a problem going from numeric to integer, so consider adding tolerance to this conversion.

Usage

asNumericNoWarn(x)

asIntegerNoWarn(x)

Arguments

x
is a vector, probably of numbers of characters

Value

  • numeric vector, may have NA values