Positions of origin locations in a spatial interaction model
Source:R/sim_positions.R
origin_positions.Rd
Functions to get or set the positions of the origin locations in a spatial interaction model.
Value
for origin_positions
NULL
or the coordinate matrix for the origin
locations. for origin_positions<-
the modified sim
object
Positions
Location positions are given by numeric matrices with 2 or 3 columns. The
first two columns are assumed to be geographical coordinates while the 3rd
column can be used for instance to store altitude. Coordinates are interpreted
as is in graphical representations (see autoplot.sim()
). They are not matched
to the costs as those can be derived from complex movement models and other
non purely geographic considerations.
Examples
positions <- matrix(rnorm(10 * 2), ncol = 2)
distances <- as.matrix(dist(positions))
production <- rep(1, 10)
attractiveness <- rep(1, 10)
model <- static_blvim(distances, production, 1.5, 1, attractiveness)
origin_positions(model) <- positions
origin_positions(model)
#> [,1] [,2]
#> [1,] 0.7091785 0.386630924
#> [2,] -1.2408429 -0.918695239
#> [3,] -0.3683273 -1.584336488
#> [4,] 0.4620801 -0.084058892
#> [5,] -0.3228331 -2.085070889
#> [6,] -1.2872148 0.003567992
#> [7,] -1.0300402 -0.355770822
#> [8,] 1.5140893 1.146359751
#> [9,] 0.3469036 -0.221188446
#> [10,] 1.7794415 1.018179021