Skip to contents

Read CARWatch raw log files

Usage

read_raw_logs(
  path,
  tz = "Europe/Berlin",
  errors = c("raise", "warn", "ignore", "error")
)

Arguments

path

CSV file, ZIP archive, directory, or vector of paths.

tz

IANA timezone for Unix timestamps.

errors

Invalid-payload handling: "error", "warn", or "ignore".

Value

A tibble of immutable raw events.

Examples

fixture <- system.file("extdata", "parity", "v1.0.0", package = "carwatch")
raw_logs <- read_raw_logs(file.path(fixture, "raw", "VP01"))
head(raw_logs)
#> # A tibble: 4 × 7
#>   participant date       timestamp            timestamp_ms action   payload     
#>   <chr>       <date>     <dttm>                      <dbl> <chr>    <list>      
#> 1 VP01        2025-05-15 2025-05-15 06:00:00 1747281600000 study_m… <named list>
#> 2 VP01        2025-05-15 2025-05-15 06:06:40 1747282000000 spontan… <named list>
#> 3 VP01        2025-05-15 2025-05-15 06:06:40 1747282000000 barcode… <named list>
#> 4 VP01        2025-05-15 2025-05-15 06:36:40 1747283800000 barcode… <named list>
#> # ℹ 1 more variable: source_file <chr>