convertNumericColumnsToNumeric: Convert character columns that represent numbers to numeric

Description Usage Arguments Value Author(s)

View source: R/Functions.R

Description

This function converts to numeric those character columns in the input that can be converted to numeric without generating missing values except for the allowed NA representations.

Usage

1
2
3
4
convertNumericColumnsToNumeric(
   data, 
   naStrings = c("NA", "NULL", "NO DATA"), 
   unFactor = TRUE)

Arguments

data

A data frame.

naStrings

Character vector of values that are allowd to convert to NA (a missing numeric value).

unFactor

Logical: should the function first convert all factor columns to character?

Value

A data frame with convertible columns converted to numeric.

Author(s)

Peter Langfelder


WGCNA documentation built on March 1, 2021, 1:05 a.m.