convertNumericColumnsToNumeric: Convert character columns that represent numbers to numeric

View source: R/Functions.R

convertNumericColumnsToNumericR Documentation

Convert character columns that represent numbers to numeric

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

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 Sept. 18, 2024, 5:08 p.m.