Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

convertNumericColumnsToNumeric

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

Weighted Correlation Network Analysis

v1.70-3
GPL (>= 2)
Authors
Peter Langfelder <Peter.Langfelder@gmail.com> and Steve Horvath <SHorvath@mednet.ucla.edu> with contributions by Chaochao Cai, Jun Dong, Jeremy Miller, Lin Song, Andy Yip, and Bin Zhang
Initial release
2021-02-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.