Learn R Programming

dataPreparation (version 0.1)

findAndTransformDates: Identify date columns in a dataSet set

Description

Function to find and transform dates. It use a bunch of default formats. But you can also add your own formats.

Usage

findAndTransformDates(dataSet, formats = NULL, n_test = 30,
  verbose = TRUE)

Arguments

dataSet

Matrix, data.frame or data.table

formats

List of additional Date formats to check (see strptime)

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 dates transformed.

Warning

All these changes will happen by reference: please send a copy() of your data.table to prepareSet if you do not want your original dataSet to be modified.

Details

This function is looking for perfect transformation. If there are some mistakes in dataSet, consider setting them to NA before.

Examples

Run this code
# NOT RUN {
# Load exemple set
data(messy_adult)
head(messy_adult)
# using the findAndTransformDates
findAndTransformDates(messy_adult, n_test = 5)
head(messy_adult)
# }

Run the code above in your browser using DataLab