# Examples that hit the live NYC Open Data API are guarded so CRAN checks
# do not fail when the network is unavailable or slow.
if (interactive() && curl::has_internet()) {
small_sample <- try(
nyc_permit_events_historic(limit = 2, timeout_sec = 10),
silent = TRUE
)
if (!inherits(small_sample, "try-error")) print(small_sample)
filtered <- try(
nyc_permit_events_historic(
limit = 2,
filters = list(event_type = "Construction"),
timeout_sec = 10
),
silent = TRUE
)
if (!inherits(filtered, "try-error")) print(filtered)
}
Run the code above in your browser using DataLab