## one-dimensional example
set.seed(1)
wa <- rep(1/5, 5)
wb <- runif(6)
wb <- wb / sum(wb)
transport_df(wa, wb)
## two-dimensional example
x <- otgrid(cbind(0:1, 1:0))
y <- otgrid(cbind(1:0, 0:1))
# first calculate pivot manually
pm <- pivot_measure(x, y)
pm <- transport_df(pm)
# or just
pm2 <- transport_df(x, y)
Run the code above in your browser using DataLab