Skip to contents

Reads the table's CSV and applies the column names and classes from the bundled schema, so the result is the same typed data frame on every platform regardless of how read.csv() would have guessed. Every table also ships as a Parquet file holding the same typed frame; format = "parquet" reads that copy instead. The first load of a table is cached for the session; later calls return the cached copy unless refresh = TRUE.

Usage

morie_data_load(slug, refresh = FALSE, format = c("csv", "parquet"))

Arguments

slug

Dataset slug; see the slug column of morie_data_catalog().

refresh

Re-read the file even if a cached copy exists.

format

"csv" (default) or "parquet": which shipped copy to read. Both give the same data frame.

Value

A data frame.

Examples

d <- morie_data_load("arsau_2023_uof_main_records")
str(d[, 1:4])
#> 'data.frame':	5 obs. of  4 variables:
#>  $ IncidentYear     : int  2024 2024 2024 2024 2024
#>  $ BatchFileName    : chr  "SYNTHETIC-FIXTURE-001" "SYNTHETIC-FIXTURE-002" "SYNTHETIC-FIXTURE-003" "SYNTHETIC-FIXTURE-004" ...
#>  $ PoliceServiceType: chr  "Municipal Police Service" "Municipal Police Service" "Provincial Police Service" "Municipal Police Service" ...
#>  $ PoliceService    : chr  "Sample Regional Police Service" "Sample Regional Police Service" "OPP" "Sample Regional Police Service" ...