Summarizes a result of cacs_run() in a list of counts and tables of the
five rates, which print.cacs_run_summary() prints.
Arguments
- object
A result of
cacs_run()in the long form (output = "long", the default). The list-column form gives an error.- ...
Not used.
- breakdown
A string choosing the rate tables that
print.cacs_run_summary()shows. With"cross_site"(the default), it showsrates_breakdown, and alsorates_per_sitewhen the result has at mostgetOption("catchmentACS.summary_per_site_max")sites, as inprint.cacs_run_result()."per_site"shows onlyrates_per_site, and"both"shows both. The elements of the list do not depend on this choice.
Value
A list of class c("cacs_run_summary", "list") with the elements
below, and an attribute breakdown that keeps the breakdown argument
for printing.
metadataThe
cacs_run_result_metadataattribute ofobject, orNULLif it has none: the values shown in the header ofprint.cacs_run_result(), the time thatcacs_run()took in seconds (wall_clock_seconds),skipped_geoids, and counts of rate rows bymoe_fallback_reason(moe_fallback_summary).n_rows,n_sites,n_variables,n_drive_timesThe number of rows, and the numbers of distinct values of
site_id,variable, anddrive_time_min.n_tracts_summaryThe five-number summary of
n_tractsfromstats::fivenum(): minimum, lower hinge, median, upper hinge, and maximum. Rows wheren_tractsisNA, such as rate rows, are left out.rates_breakdownA tibble with one row for each of the five rates (
variable). The columns are the unweighted mean (mean) and the standard deviation (sd) of the rate over all site and drive-time pairs, leaving out missing values, andn_NA, the number of pairs where the rate is missing.print.cacs_run_result()shows the same means and standard deviations as "Top 5 rates", under the namesmean_estimateandsd_estimate. The last column of that table,n, counts all the pairs, including those where the rate is missing.rates_per_siteA tibble of the estimates of the five rates, with one row for each site and drive time (
site_id,drive_time_min).rates_per_site_moeThe same table with each cell a string giving the estimate and its margin of error (the half-width of its confidence interval), rounded to three decimals. When
objecthas the attributecacs_confidence_level, the table has it as well, andcacs_summary_as_markdown()names that level in its caption.moe_fallback_rateThe number of rows whose
moe_fallbackisTRUE(seecacs_run()), divided by the number of all rows.
Examples
# A bundled cacs_run() result for a 10-minute area in Birmingham, Alabama
out <- readRDS(system.file("extdata", "visual_walkthrough_fixture.rds",
package = "catchmentACS"))$run_result
s <- summary(out)
s
#>
#> ── catchmentACS run summary ────────────────────────────────────────────────────
#> Generated at: 2026-05-29 17:15:15
#> Provider: osrm / car
#> Sites: 1 success / 0 failed / 1 total
#>
#> ── Run tallies ──
#>
#> Rows: 19
#> Sites: 1
#> Variables: 19
#> Drive-time bands: 1
#>
#> ── n_tracts five-number summary ──
#>
#> min=36, q1=36, median=36, q3=36, max=36
#>
#> ── Rates breakdown (mean / sd / n_NA) ──
#>
#> # A tibble: 5 × 4
#> variable mean sd n_NA
#> <chr> <dbl> <dbl> <int>
#> 1 labor_force_participation 0.649 NA 0
#> 2 poverty_rate 0.193 NA 0
#> 3 snap_rate 0.112 NA 0
#> 4 ssi_rate 0.0504 NA 0
#> 5 unemp_rate 0.0424 NA 0
#> ── Rates per site ──
#>
#> # A tibble: 1 × 7
#> site_id drive_time_min poverty_rate snap_rate ssi_rate unemp_rate
#> <chr> <int> <dbl> <dbl> <dbl> <dbl>
#> 1 AL_BHM_01 10 0.193 0.112 0.0504 0.0424
#> # ℹ 1 more variable: labor_force_participation <dbl>
#> ── MOE fallback rate ──
#>
#> 0% of rows fell back
# The rates with their margins of error
s$rates_per_site_moe
#> # A tibble: 1 × 7
#> site_id drive_time_min poverty_rate snap_rate ssi_rate unemp_rate
#> <chr> <int> <chr> <chr> <chr> <chr>
#> 1 AL_BHM_01 10 0.193 ± 0.024 0.112 ± 0.013 0.050 ± 0.008 0.042 ± 0.…
#> # ℹ 1 more variable: labor_force_participation <chr>