Learn R Programming

OasisR (version 3.1.0)

area: A function to compute the spatial units' areas

Description

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).

Usage

area(spatobj = NULL, folder = NULL, shape = NULL)

Value

A area vector

Arguments

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

See Also

Other spatial functions used for segregation indices computation: contig, perimeter, distance, distcenter, boundaries

Examples

Run this code
 area(segdata) 
foldername <- system.file('extdata', package = 'OasisR')
shapename <- 'segdata'
area(folder = foldername, shape = shapename)

Run the code above in your browser using DataLab