Learn R Programming

latticeDensity (version 1.2.6)

areaRegion: Computes area of a region

Description

This function computes the area of a region by first finding the area of the bounding polygon, then subtracting the area of each hole.

Usage

areaRegion(formLatticeOutput)

Arguments

formLatticeOutput

An object returned by formLattice or editLattice.

Value

Numeric The area of the bounded region.

Warning

Note that this program does not check to see if the holes are non-intersecting or if the holes intersect the polygon.

Examples

Run this code
# NOT RUN {
data(areaRegionExample)
attach(areaRegionExample)
hole_list <- list(hole1,hole2)
nodeFillingOutput <- nodeFilling(poly=boundary, node_spacing=0.03,
                               hole_list = hole_list)
formLatticeOutput <- formLattice(nodeFillingOutput)
plot(formLatticeOutput)
areaRegion(formLatticeOutput)
# }

Run the code above in your browser using DataLab