mean_od_vectors: Compute the mean vectors of an OD matrix

View source: R/ttt_mean_od_vectors.R

mean_od_vectorsR Documentation

Compute the mean vectors of an OD matrix

Description

Compute the mean vectors of an OD matrix

Usage

mean_od_vectors(pts, OD)

Arguments

pts

sf data.frame with point geometries

OD

an OD matrix with as many rows as pts

Value

An sf data.frame similar to pts with dx and dy columns that store the mean vectors.

Examples

# data(munich)
# sf=mean_od_vectors(munich$coords,minich$OD)
# ggplot(sf)+geom_segment(aes(x=x,y=y,xend=x+dx*100,yend=y+dy*100),arrow = arrow(angle=15,length = unit(0.3,"cm"),type = "closed"))+theme_void()

tributetotobler/ttt documentation built on Sept. 15, 2022, 5:41 p.m.