Skip to contents

The 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.

Usage

morie_arsau_sidecar_to_frame(sidecar)

Arguments

sidecar

A list as returned by morie_arsau_read_sidecar().

Value

A data.frame (zero rows if records is empty).

References

CKAN datastore_search response schema.

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