toNum function

To Numeric.

To Numeric.

This function checks if your vector is not a character and if it is, then converts it to a numeric.

toNum(x)

Arguments

  • x: A character, factor, or numeric vector.

Returns

toNum Returns a numeric vector.

Examples

# vector of factors fact <- factor(c("1", "2", "3", "4")) # convert to numeric num <- toNum(x = fact)
  • Maintainer: Dustin Sokolowski
  • License: GPL-3
  • Last published: 2023-06-30