Skip to contents

Takes the tibble created by read_output_trips and an sf object (can be created using the function st_read()) to first use the function process_append_spatialcat to categorize all trips into the following spatial categories: - inside: trips that start and end inside the given shape - originating: trips that start inside the shape and end outside of the shape - destinating: trips that end inside the shape and start outside of the shape - outside: trips that start and end outside of the shape

Usage

plot_distance_by_spatialcat_barchart(
  trips_table,
  shape_table,
  crs,
  euclidean = FALSE
)

Arguments

trips_table

tibble of trips_output (from read_output_trips)

shape_table

sf object(data frame with geometries), can be created using st_read(), is used to categorize the trips.

crs

numeric representation of the EPSG code or proj4string for the corresponding coordinate system of the trip coordinates, can be found in network file from output directory of MATSim simulation

euclidean

boolean indicating whether to calculate the average as euclidean distance or as travel distance. Default is FALSE, which calculates the average traveled distance.

Value

Bar chart plot of distance traveled by spatial type

Details

In a next step a bar chart of the sum of traveled distance for each trip type is created.