Skip to contents

Calculate pairwise wind cost-distances (e.g. travel times) or flow rates (the inverse of cost-distances) among a set of sites, using the least cost path algorithm. This function is a wrapper around costDistance.

Usage

least_cost_distance(graph, sites, adjust = TRUE, rate = FALSE)

Arguments

graph

A wind_graph.

sites

A two-column matrix of point coordinates.

adjust

Whether to scale results to correct for discrepancies between point-to-point distances and cell-to-cell distances. Default is TRUE.

rate

Whether to return values as "rates" instead of the default "cost distances". Rates are the inverse of cost distances, representing flow rather than travel time.

Value

A square matrix of wind travel times.