Skip to contents

Reads the three-header CSV produced by either carwatch-python or write_study_results(). The returned object preserves opaque identifiers, time zones, and column placement.

Usage

read_study_results(path, tz = "Europe/Berlin", simple = FALSE)

Arguments

path

Path to a three-header Study Results CSV.

tz

IANA study timezone.

simple

Return a display-only subset.

Value

A carwatch_results object.

Examples

fixture <- system.file("extdata", "parity", "v1.0.0", package = "carwatch")
results <- read_study_results(file.path(fixture, "results.csv"))
as_study_days(results)
#> # A tibble: 1 × 17
#>   participant day   date                awakening_time      awakening_type      
#>   <chr>       <chr> <dttm>              <dttm>              <chr>               
#> 1 VP01        D1    2025-05-15 00:00:00 2025-05-15 06:06:40 spontaneous_awakeni…
#> # ℹ 12 more variables: mismatch_summary <chr>, registration <int>,
#> #   study_name <chr>, registration_day <int>, registration_sources <chr>,
#> #   possible_reregistration <lgl>, day_compliant <lgl>,
#> #   expected_sample_count <int>, recorded_sample_count <int>,
#> #   assessed_sample_count <int>, compliant_sample_count <int>,
#> #   non_compliant_samples <chr>