
Fetch a Calgary Open Data Socrata dataset by ID
Source:R/datasets_canadian_cities.R
morie_datasets_calgary_socrata_by_id.RdPhase 3FFF3. Generic SODA2 fetch wrapper for arbitrary Calgary Socrata resources.
Usage
morie_datasets_calgary_socrata_by_id(soda_id, limit = 1000L)
morie_datasets_edmonton_socrata_by_id(soda_id, limit = 1000L)Value
A data.frame of records.
A data.frame of the requested dataset (a 0-row typed frame when the
data is unavailable offline).
Examples
# \donttest{
if (requireNamespace("rmoriedata", quietly = TRUE)) withAutoprint({
cat_df <- morie_datasets_calgary_opendata_bulk_layers()
df <- try(morie_datasets_calgary_socrata_by_id(cat_df$soda_id[1], limit = 5L))
if (!inherits(df, "try-error")) head(df)
})
#> > cat_df <- morie_datasets_calgary_opendata_bulk_layers()
#> > df <- try(morie_datasets_calgary_socrata_by_id(cat_df$soda_id[1], limit = 5L))
#> > if (!inherits(df, "try-error")) head(df)
#> incident_info
#> 1 9 Avenue and 16 Street SE
#> 2 Elbow Drive and Sabrina Road SW
#> 3 Northbound Deerfoot Trail approaching 17 Avenue SE
#> 4 50 Avenue and 1a Street SE
#> 5 Eastbound Glenmore Trail and Deerfoot Trail SE
#> description
#> 1 Traffic incident.
#> 2 There is an incident involving a pedestrian- EMS on site.
#> 3 Traffic incident.
#> 4 Traffic incident.
#> 5 Traffic incident. Blocking the left lane
#> start_dt_utc modified_dt_utc quadrant longitude
#> 1 2026-09-18T21:36:31.000 2026-09-18T21:39:16.000 SE -114.02215204531316
#> 2 2026-09-18T22:24:28.000 2026-09-18T22:25:04.000 SW -114.08469755874496
#> 3 2026-09-18T22:35:44.000 2026-09-18T22:54:26.000 SE -114.01014602121316
#> 4 2026-09-18T22:23:12.000 2026-09-18T23:03:21.000 SE -114.06138745986647
#> 5 2026-09-18T23:31:40.000 2026-09-18T23:42:31.000 SE -114.03925199779404
#> latitude count
#> 1 51.03643495929764 1
#> 2 50.95700998524688 1
#> 3 51.037056011647046 1
#> 4 51.00871500829836 1
#> 5 50.994171041580366 1
#> id
#> 1 2026-09-18 21:36:31+00:0051.03643495929764-114.02215204531316
#> 2 2026-09-18 22:24:28+00:0050.95700998524688-114.08469755874496
#> 3 2026-09-18 22:35:44+00:0051.037056011647046-114.01014602121316
#> 4 2026-09-18 22:23:12+00:0051.00871500829836-114.06138745986647
#> 5 2026-09-18 23:31:40+00:0050.994171041580366-114.03925199779404
#> :@computed_region_kxmf_bzkv :@computed_region_4a3i_ccfj
#> 1 54 3
#> 2 7 1
#> 3 121 3
#> 4 160 3
#> 5 109 3
#> :@computed_region_4b54_tmc4
#> 1 10
#> 2 8
#> 3 10
#> 4 10
#> 5 10
# }
# \donttest{
cat_df <- morie_datasets_edmonton_opendata_bulk_layers()
df <- try(morie_datasets_edmonton_socrata_by_id(cat_df$soda_id[1], limit = 5L))
if (!inherits(df, "try-error")) head(df)
#> data frame with 0 columns and 5 rows
# }
# \donttest{
cat_df <- morie_datasets_edmonton_opendata_bulk_layers()
df <- try(morie_datasets_edmonton_socrata_by_id(cat_df$soda_id[1], limit = 5L))
if (!inherits(df, "try-error")) head(df)
#> data frame with 0 columns and 5 rows
# }