Skip to contents

Matches epoch rows to summary rows by id (w_id/sleep_id) and adds a datetime column converted from unix timestamp using the matched timezone.

Usage

combine_withings_epoch_summary(
  epochs,
  summary,
  id_cols = c("w_id", "sleep_id", "id"),
  tz_cols = c("w_timezone", "timezone")
)

Arguments

epochs

tibble/data.frame with columns id or w_id, and timestamp (unix seconds)

summary

tibble/data.frame from withings_json_to_df() or CSV with w_id/sleep_id and timezone

id_cols

character vector of candidate id column names (default: c("w_id","sleep_id","id"))

tz_cols

character vector of candidate timezone columns (default: c("w_timezone","timezone"))

Value

list with elements: summary (tibble), epoch (tibble with datetime_utc and datetime_local_chr), and a join map