tc_set_edge_weights.Rd
Set the edge weights of a travelcost graph
tc_set_edge_weights(x, fun, values)
x | tc_graph: an object of class |
---|---|
fun | function or string: a function or name of function. |
values | numeric: A vector of edge weights. The length of |
A tc_graph
object with the edge weights set
if (FALSE) { my_raster <- raster::raster(ext = raster::extent(c(152.75, 155.25, -56.25, -54.25)), res = c(0.5, 0.5), crs = "+proj=longlat") g <- tc_build_graph(my_raster) ## set weights according to great-circle distance g <- tc_set_edge_weights(g, fun = geosphere::distHaversine) }