dot-check_time_shift.aidR: Warn if the entries of two formats are shifted by one hour

.check_time_shift.aidRR Documentation

Warn if the entries of two formats are shifted by one hour

Description

Exports of overlapping time periods may be shifted by one hour, e.g. because of daylight saving time or time zone settings. Their entries are then not detected as near-duplicates. For each pair of formats, the number of near-duplicates is counted with the timestamps as they are, and with the timestamps of one format shifted by +/- 1 hour. A warning is given if a shift yields at least min_matches near-duplicates, and more than twice as many as without the shift. Nothing is changed in the data.

Usage

.check_time_shift.aidR(
  df,
  type,
  col,
  tol,
  max_minutes = 5,
  min_matches = 5,
  col2 = NULL,
  tol2 = NULL
)

Arguments

df

A data frame with the cleaned data of one data type.

type

Name of the data type (used in the warning).

col

Name of the column holding the value.

tol

Maximum difference in value between two near-duplicates.

max_minutes

Maximum time difference (in minutes) between two near-duplicates.

min_matches

Minimum number of near-duplicates with the shift to give a warning.

col2

Optional name of a second column that must match as well, or NULL.

tol2

Maximum difference in col2 between two near-duplicates.

Value

TRUE (invisibly) if a warning was given, FALSE otherwise.


aidR documentation built on Oct. 28, 2026, 5:13 p.m.