Learn R Programming

dataPreparation (version 0.4.3)

findAndTransformNumerics: Identify numeric columns in a dataSet set

Description

Function to find and transform characters that are in fact numeric.

Usage

findAndTransformNumerics(dataSet, cols = "auto", n_test = 30, verbose = TRUE)

Arguments

dataSet

Matrix, data.frame or data.table

cols

List of column(s) name(s) of dataSet to look into. To check all all columns, set it to "auto". (characters, default to "auto")

n_test

Number of non-null rows on which to test (numeric, default to 30)

verbose

Should the algorithm talk? (logical, default to TRUE)

Value

The dataSet set (as a data.table) with identified numeric transformed.

Warning

All these changes will happen by reference.

Details

This function is looking for perfect transformation. If there are some mistakes in dataSet, consider setting them to NA before. If there are some columns that have no chance to be a match think of removing them from cols to save some computation time.

Examples

Run this code
# NOT RUN {
# Let's build a dataSet set
dataSet <- data.frame(ID = 1:5,
                  col1 = c("1.2", "1.3", "1.2", "1", "6"), 
                  col2 = c("1,2", "1,3", "1,2", "1", "6")
                  )

# using the findAndTransformNumerics
findAndTransformNumerics(dataSet, n_test = 5)
# }

Run the code above in your browser using DataLab