Convert character columns that represent numbers to numeric
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.
convertNumericColumnsToNumeric( data, naStrings = c("NA", "NULL", "NO DATA"), unFactor = TRUE)
data |
A data frame. |
naStrings |
Character vector of values that are allowd to convert to |
unFactor |
Logical: should the function first convert all factor columns to character? |
A data frame with convertible columns converted to numeric.
Peter Langfelder
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.