distance | R Documentation |
The function is based on sf package and can be used with a shape file or an R spatial object (class sf, sfc or sfg).
distance(spatobj = NULL, folder = NULL, shape = NULL,
distin = 'm', distout = 'm', diagval = '0')
spatobj |
a spatial object (class sf, sfc or sfg) containing geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile with the geographic information is located. |
shape |
a character vector with the name of the shapefile (without the .shp extension) which contains the geographic information |
distin |
input metric conversion, based on measurements package and includes conversions from 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
distout |
output metric conversion, based on measurements package and includes conversions to 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
diagval |
the user has the choice of the definition of the diagonal: diagval = '0' (by default) for an 'empty' diagonal and diagval = 'a' to compute the diagonal as 0.6 * square root (spatial units area) (White, 1983) |
A matrix with the distance between spatial units centroids
Other spatial functions used for segregation indices
computation: area
, contig
,
perimeter
, distcenter
,
boundaries
distance(segdata)
foldername <- system.file('extdata', package = 'OasisR')
shapename <- 'segdata'
distance(folder = foldername, shape = shapename)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.