Extract the flow matrix from a spatial interaction model object
Examples
positions <- matrix(rnorm(10 * 2), ncol = 2)
distances <- as.matrix(dist(positions))
production <- rep(1, 10)
attractiveness <- c(2, rep(1, 9))
model <- static_blvim(distances, production, 1.5, 1, attractiveness)
flows(model)
#> 1 2 3 4 5 6
#> 1 0.58128391 0.025458910 0.04684689 0.05848390 0.03607918 0.05852402
#> 2 0.13016862 0.371505120 0.07323146 0.01921715 0.05141161 0.05612128
#> 3 0.16018674 0.048975287 0.24845291 0.04934854 0.16702976 0.17155850
#> 4 0.21093941 0.013556383 0.05205350 0.26207147 0.05389922 0.07538260
#> 5 0.13416326 0.037391400 0.18164568 0.05556970 0.27019375 0.16621311
#> 6 0.18546418 0.034784600 0.15899826 0.06623318 0.14164922 0.23026303
#> 7 0.36517338 0.024676357 0.02998645 0.04890420 0.02269232 0.03677474
#> 8 0.14870307 0.009364505 0.03940146 0.17804164 0.04479849 0.05649520
#> 9 0.09976814 0.271448028 0.05424589 0.01409669 0.03857196 0.04113340
#> 10 0.24306093 0.018928499 0.07171756 0.14522908 0.07008341 0.10363505
#> 7 8 9 10
#> 1 0.07132486 0.028850116 0.016822711 0.07632550
#> 2 0.02464276 0.009289214 0.234022328 0.03039045
#> 3 0.02002685 0.026138803 0.031276398 0.07700622
#> 4 0.03445160 0.124586408 0.008573194 0.16448622
#> 5 0.01648154 0.032319753 0.024185371 0.08183643
#> 6 0.02276236 0.034734824 0.021979843 0.10313049
#> 7 0.37201159 0.028231158 0.017923248 0.05362656
#> 8 0.02842123 0.374516251 0.005909444 0.11434871
#> 9 0.02076130 0.006799394 0.430917567 0.02225765
#> 10 0.03335548 0.070648737 0.011951677 0.23138958