powered by
The function is based on rgdal and rgeos packages and it can be used with a shape file or an R spatial object (SpatialPolygonsDataFrame).
distcenter(spatobj = NULL, folder = NULL, shape = NULL, center = 1, distin = 'm', distout = 'm')
- a spatial object (SpatialPolygonsDataFrame) containing geographic information
- a character vector with the folder (directory) name indicating where the shapefile with the geographic information is located.
- a character vector with the name of the shapefile (without the .shp extension) which contains the geographic information
- the row number of the center
- input metric conversion, based on bink package and includes conversions from 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc.
- output metric conversion, based on bink package and includes conversions to 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc.
A vector with the distance to the center's centroid
Other spatial functions used for segregation indices computation: area, contig, perimeter, distance, boundaries
area
contig
perimeter
distance
boundaries
# NOT RUN { distcenter(segdata, center = 46) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' distcenter(folder = foldername, shape = shapename, center = 19) # }
Run the code above in your browser using DataLab