toNum: To Numeric.

View source: R/toNum.R

toNumR Documentation

To Numeric.

Description

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

Usage

toNum(x)

Arguments

x

A character, factor, or numeric vector.

Value

toNum Returns a numeric vector.

Examples


 
 # vector of factors
fact <- factor(c("1", "2", "3", "4"))
# convert to numeric
num <- toNum(x = fact)
 

scMappR documentation built on July 9, 2023, 6:26 p.m.