routes-methods: Tidy and glance methods for routes and frontiers

routes-methodsR Documentation

Tidy and glance methods for routes and frontiers

Description

tidy() of a fieldopt_routes returns one row per stop (route, stop, unit, and leg, the travel from the previous stop or the depot); glance() one row with the total travel, the lower bound, the gap, the number of routes and the cost when a model was given. glance() of a fieldopt_frontier returns one row with the range of sample sizes, costs and variances covered, the selection method and the replicates.

Usage

## S3 method for class 'fieldopt_routes'
tidy(x, ...)

## S3 method for class 'fieldopt_routes'
glance(x, ...)

## S3 method for class 'fieldopt_frontier'
glance(x, ...)

## S3 method for class 'fieldopt_schedule'
tidy(x, ...)

## S3 method for class 'fieldopt_schedule'
glance(x, ...)

Arguments

x

A fieldopt_routes or fieldopt_frontier.

...

Unused.

Value

A tibble.

Examples

set.seed(1)
pts <- data.frame(unit = c("depot", paste0("s", 1:8)), x = c(0, runif(8)), y = c(0, runif(8)))
r <- route_fieldwork(travel_matrix(pts, method = "euclidean"), paste0("s", 1:8), "depot",
  max_stops = 4, iterations = 20
)
tidy(r)
glance(r)

fieldopt documentation built on Oct. 22, 2026, 1:07 a.m.