compare_areas {stppSim}R Documentation

Compare two areas

Description

To compare the sizes of two areas (boundary shapefiles).

Usage

compare_areas(area1, area2,
display_output = FALSE)

Arguments

area1

(as spatialPolygons, spatialPolygonDataFrames, or ⁠simple features⁠). the polygon object of the first area.

area2

(as spatialPolygons, spatialPolygonDataFrames, or ⁠simple features⁠). the polygon object of the second area.

display_output

(logical) Whether to print output in the console. Default: FALSE

Details

Compares the sizes of two areas (polygon shapefiles). The two shapefiles can be in any crs, and any spatial object formats. If enabled, the output (a value) comparing the area of the two polygons is printed. This value can be used to scale some specific spatial parameters, including n_origin, s_threshold, and step_length.

Value

Returns a plot and a text (string) comparing the sizes of two areas.

Examples

#load 'area1' object - boundary of Camden, UK
load(file = system.file("extdata", "camden.rda",
package="stppSim"))
camden_boundary = camden$boundary

#load 'area2' - boundary of Birmingham, UK
load(file = system.file("extdata", "birmingham_boundary.rda",
package="stppSim"))

#run
compare_areas(area1 = camden_boundary,
area2 = birmingham_boundary, display_output = FALSE)

[Package stppSim version 1.3.2 Index]