testCharacterDate: testCharacterDate

Description Usage Arguments Details Examples

View source: R/testCharacterDate.R

Description

This function is intended to test a characters date that was recently converted from a text file.

Usage

1
2
testCharacterDate(characterDate, testUpperLimit = 100,
  testPercentPositive = 50)

Arguments

characterDate

the date and or time an event occured

testUpperLimit

number of tests to perform to validate

testPercentPositive

percent positive to confirm one date type

Details

It can extract features about the date using regular expressions

This function assumes the dateSeparator is "-", ".", or "/"

format = "american" ... date order is (1) mm (2) day (3) year format = "british" ... date order is (1) day (2) mm (3) year format = "international" ... date order is (1) year (2) mm (3) day

This function outputs a list of named parameters

dateSeparator - character used to separate dates dateTimeSeparator - chacters used to separate date and time american - is this american formatted date british - is this a British formatted date international - is this an internationl formatted date fullYear - is a full year given partialYear - is a partial year given withTime - is the time given withoutTime - is time not given formatStyle - American, British, International, or Unknown yearFormat - Full or Partial timePresent - is the time given

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 
 testCharacterDate("2018-01-05 13:45:01")
 testCharacterDate("2018/04/30 15:07:41")
 testCharacterDate("2018/04/30 15:07")
 
 
 # This date outputs an unknown format style because the
 # American and British styles can become confused.   
 testCharacterDate("01-01-2010 12:00:00")     
 

JerryHMartin/EmissionsHelper documentation built on July 15, 2020, 12:44 a.m.