calculates a cost distance matrix, to be used with run.popgensim
gl.costdistances(landscape, locs, method, NN)
a raster object coding the resistance of the landscape
coordinates of the subpopulations. If a genlight object is provided coordinates are taken from @other$latlong and centers for population (pop(gl)) are calculated. In case you want to calculate costdistances between individuals redefine pop(gl) via: pop(gl)<- indNames(gl)
.
defines the type of cost distance, types are "least-cost", "rSPDistance" or "commute (Circuitscape type)"
number of next neighbours recommendation is 8
a costdistance matrix between all pairs of locs