
Convert a CKAN sidecar's records array-of-arrays into a data.frame.
Source: R/arsau_datasets.R
morie_arsau_sidecar_to_frame.RdThe fields[].id array supplies the column names; records
are array-of-array, so the column order in the JSON matches the
column order in the resulting data.frame.
Arguments
- sidecar
A list as returned by
morie_arsau_read_sidecar().
Examples
sc <- list(
fields = list(list(id = "PoliceService", type = "text"),
list(id = "IncidentYear", type = "int")),
records = list(
list(PoliceService = "Toronto", IncidentYear = 2023L),
list(PoliceService = "OPP", IncidentYear = 2023L)))
morie_arsau_sidecar_to_frame(sc)
#> PoliceService IncidentYear
#> 1 Toronto 2023
#> 2 OPP 2023