chr2nu: Internal function for quick class change of a vector to...

Description Usage Arguments Value Author(s)

View source: R/InternalSimple_functions.R

Description

This function takes a factor vector and changes it to a numeric. This is primarily to avoid instances where a csv file has been opened without column classes being specified, which can result in numeric values being accidently read as factors, which in turn when treated with as.numeric() will accidently be given integer values in the order of the factor levels. By treating the values as characters first it avoids this potential error.

Usage

1
chr2nu(X)

Arguments

x

is a vector to be converted to a numeric vector

Value

This function returns a numeric vector

Author(s)

Ardern Hulme-Beaman


ArdernHB/KnnDist documentation built on Feb. 5, 2021, 5:09 a.m.