View source: R/calculate_geodesic_distances.R

calculate_geodesic_distances | R Documentation |

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

```
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
)
```

`trajectory` |
The trajectory as created by |

`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 |

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

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

```
geodesic_distances <- calculate_geodesic_distances(example_trajectory)
geodesic_distances[1:10, 1:10]
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.