Learn R Programming

dynwrap (version 1.2.4)

calculate_geodesic_distances: Calculate geodesic distances between cells in a trajectory

Description

Will calculate geodesic distances between cells within a trajectory. To speed things up, only the distances with a set of waypoint cells are calculated.

Usage

calculate_geodesic_distances(
  trajectory,
  waypoint_cells = NULL,
  waypoint_milestone_percentages = NULL,
  directed = FALSE
)

compute_tented_geodesic_distances( trajectory, waypoint_cells = NULL, waypoint_milestone_percentages = NULL )

Value

A matrix containing geodesic distances between each waypoint cell (rows) and cell (columns)

Arguments

trajectory

The trajectory as created by infer_trajectory() or add_trajectory()

waypoint_cells

A vector of waypoint cells. Only the geodesic distances between waypoint cells and all other cells will be calculated.

waypoint_milestone_percentages

The milestone percentages of non-cell waypoints, containing waypoint_id, milestone_id and percentage columns

directed

Take into account the directions of the milestone edges. The cells that cannot be reached from a particular waypoint will have distance infinity. You can also give a character, if it is "forward" it will look forward, if it is "reverse" it will look in the reversed direction

Details

The geodesic distance takes into account the length of an edge regions of delayed commitment.

Examples

Run this code
geodesic_distances <- calculate_geodesic_distances(example_trajectory)
geodesic_distances[1:10, 1:10]

Run the code above in your browser using DataLab