Skip to contents

Provides a summary table of geodesic statistics with percentages and counts for different metric types.

Usage

# S3 method for class 'geodesic_stats'
summary(object, type = c("rays", "composite", "overlap"), ...)

Arguments

object

A geodesic_stats object from compute.geodesic.stats().

type

Character. Type of summary to generate: "rays" (default), "composite", or "overlap".

...

Additional arguments passed to summary.

Value

A matrix with row for each radius and columns for each unique count value. Each cell contains a string with "percent (count)" format.

Examples

stats <- list(
  radii = c(0.2, 0.4),
  geodesic_rays = matrix(c(2, 3, 3, 4), nrow = 2, byrow = TRUE),
  composite_geodesics = matrix(c(1, 1, 1, 2), nrow = 2, byrow = TRUE),
  path_overlap = list(
    min = matrix(c(0.1, 0.2, 0.2, 0.3), nrow = 2, byrow = TRUE),
    p05 = matrix(c(0.1, 0.2, 0.2, 0.3), nrow = 2, byrow = TRUE),
    p25 = matrix(c(0.2, 0.3, 0.3, 0.4), nrow = 2, byrow = TRUE),
    median = matrix(c(0.3, 0.4, 0.4, 0.5), nrow = 2, byrow = TRUE),
    p75 = matrix(c(0.4, 0.5, 0.5, 0.6), nrow = 2, byrow = TRUE),
    p95 = matrix(c(0.5, 0.6, 0.6, 0.7), nrow = 2, byrow = TRUE),
    max = matrix(c(0.6, 0.7, 0.7, 0.8), nrow = 2, byrow = TRUE)
  )
)
class(stats) <- c("geodesic_stats", "list")

summary(stats)
#> Summary of Geodesic Rays (2 grid vertices):
#> 
#>               2        3        4       
#> Radius 0.2000 50.0 (1) 50.0 (1)         
#> Radius 0.4000          50.0 (1) 50.0 (1)
summary(stats, type = "composite")
#> Summary of Composite Geodesics (2 grid vertices):
#> 
#>               1         2       
#> Radius 0.2000 100.0 (2)         
#> Radius 0.4000 50.0 (1)  50.0 (1)
summary(stats, type = "overlap")
#>   radius min p05 p25 median mean p75 p95 max
#> 1    0.2 0.1 0.1 0.2   0.35 0.35 0.5 0.6 0.7
#> 2    0.4 0.2 0.2 0.3   0.45 0.45 0.6 0.7 0.8