Skip to contents

Replaces the date-times in columns with integer offsets from timestamp, and replaces timestamp with the integer offset from the minimum timestamp per group identified by by.

Usage

dataset_normalize_timestamps(
  dataset,
  timestamp_cols = grep("timestamp", colnames(dataset), value = T, ignore.case = T),
  by = "group_customer_no",
  ...
)

Arguments

dataset

data.table of data to normalize

timestamp_cols

character vector of columns to normalize; defaults to all columns with a name containing the word timestamp

by

character column name to group the table by

...

not used

Value

normalized data.table