aoristic.datacheck {aoristic}R Documentation

Check aoristic input data

Description

A function that flags datetime errors with aoristic input data.

Usage

aoristic.datacheck(data1, Xcoord, Ycoord, DateTimeFrom, DateTimeTo)

Arguments

data1

data.frame with a minimum of 4 columns with X, Y coords, Start and End date/time

Xcoord

a vector of the X coordinate or latitude (numeric object)

Ycoord

a vector of the Y coordinate or longitude (numeric object)

DateTimeFrom

a vector of the column name for FromDateTime (POSIXct date-time object)

DateTimeTo

a vector of the column name for ToDateTime (POSIXct date-time object)

Details

The aoristic.df function handles data with Start (or From) and End (or To) datetime objects. Sometimes these data can be messy or inaccurately recorded (such as crime data from some police departments). This function checks for common problems and reports the result in a column labeled 'aoristic_datacheck'.

Rows with missing 'End' information are flagged with '1' and counted in the console. Rows where the 'End' datetime occurs before the 'Start' datetime are flagged '2'.

Note that aoristic.df() will still run even with the data issues. Where the 'End' datetime is missing, the aoristic value will be assigned to the 'Start' datetime hour. When the 'End' datetime comes before the 'Start' datetime, the 'Start' datetime is only used and again, the aoristic value is assigned to the 'Start' datetime hour.

Value

A data frame flagging any problems or logical errors from an aoristic data check

References

Ratcliffe, J. H. (2002). Aoristic signatures and the spatio-temporal analysis of high volume crime patterns. Journal of Quantitative Criminology, 18(1), 23-43.

Examples

datacheck.df <- aoristic.datacheck(dcburglaries, 'X', 'Y', 'StartDateTime', 'EndDateTime')

[Package aoristic version 1.1.1 Index]