GapFinder: Find gaps in your data file

Description Usage Arguments Value Author(s) Examples

View source: R/GapFinder.R

Description

The function looks at the DateTime or Date and Time stamps of your data file and sees if any consecutive entries have a difference of greater than the timediff parameter.

Usage

1
GapFinder(rawdata, timediff = 1, timeformat = "%d-%b-%Y %H:%M:%S")

Arguments

rawdata

Data with a combined DateTime or separate Date and Time stamp columns labeled as such.

timediff

The amount of time in seconds that is expected between each entry (row). Typically this would be your data collection Hz (for Hz=16,timediff=1/16, for Hz=0.5, timediff=2) but results will depend on whether or not you have information on decimal seconds. One second is probably small enough for most people and will avoid issues with decimal seconds, but this depends on the scale that is important to you.

timeformat

Format of the DateTime or separate Date and Time stamp after it is pasted together with a space between. See the strptime function for codes. The default value is the value of the example files.

Value

Returns a data frame with 4 columns indicating the row that the gap occurs, the amount of time between the gap, and the DateTime stamp on either end of the gap. The data frame holds a maximum of 1000 entries, so if you have more gaps, then you can alter the program to create a larger dataframe. Hopefully you don't have anywhere near that many gaps.

Author(s)

Brian Battaile

Examples

1
2
3
4
5
data(rawdatagap)
gaps<-GapFinder(rawdatagap, timediff = 1, timeformat = "%d-%b-%Y %H:%M:%S")

#how timediff and a lack of decimal seconds information interact given a Hz of 16.
gaps<-GapFinder(rawdatagap, timediff = 1/16, timeformat = "%d-%b-%Y %H:%M:%S")

TrackReconstruction documentation built on Dec. 11, 2021, 10:07 a.m.