Skip to contents

traveltime_stats() generates a summary of the traveltime() function results, producing a statistic for the percent of demand which is covered within a given objective travel time along with a cumulative curve plot.

Usage

traveltime_stats(
  traveltime,
  demand,
  objectiveminutes = 15,
  breaks = c(5, 10, 15, 30),
  print = TRUE
)

Arguments

traveltime

A list with the output of the traveltime() function.

demand

A RasterLayer object with the demand layer (e.g. population density).

objectiveminutes

(optional) A number indicating the target travel time in minutes used to compute the statistics (default: 15).

breaks

(optional) A numeric object indicating the breaks (in minutes) for the cumulative curve plot (default: c(5, 10, 15, 30)).

print

(optional) A logical flag indicating whether to print the results to the console (default: TRUE).

Value

An invisible list with the following elements:

  • coverage: A numeric value indicating the share of demand covered within the objective travel time.

  • unmet_demand: A numeric value indicating the share of demand that remains unmet.

  • data: A tibble object with the data used to generate the cumulative curve plot.

  • plot: A ggplot object with the cumulative curve plot.

See also

Other travel time functions: friction(), traveltime(), traveltime_plot()

Examples

if (FALSE) { # \dontrun{
  traveltime_data <-
    naples_fountains |>
    traveltime(
      bb_area = naples_shape,
      dowscaling_model_type = "lm",
      mode = "walk",
      res_output = 100
    )

  traveltime_data |>
    traveltime_stats(
      demand = naples_population,
      objectiveminutes = 15,
      breaks = c(5, 10, 15, 30)
    )
} # }