Scans a recording tibble for three classes of timestamp problem:
Arguments
- x
A tibble as returned by
read_acttrust()orprepare_actigraphy(), containing adatetimecolumn.- gap_s
numeric(1). Gap threshold in seconds. Intervals longer than this are flagged. Default is120(2 minutes).- datetime_col
character(1). Name of the datetime column. Default is"datetime".
Value
A tibble with one row per detected issue and columns:
rowinteger— row index inxwhere the issue occurs.datetimePOSIXct— timestamp at that row.issuecharacter— one of"gap","backward_jump", or"year_artefact".detailcharacter— human-readable description.
Returns a zero-row tibble if no issues are found.
Details
Gaps — intervals between consecutive epochs longer than
gap_sseconds.Backward jumps — timestamps that go backwards in time.
Year artefacts — timestamps in the years 1970 or 2000, which typically indicate firmware epoch-counter rollover bugs.
Examples
if (FALSE) { # \dontrun{
rec <- read_acttrust("recordings/P001.txt")
issues <- check_consistency(rec)
issues
} # }