View source: R/compare_areas.R
compare_areas | R Documentation |
To compare the sizes of two areas (boundary shapefiles).
compare_areas(area1, area2,
display_output = FALSE)
area1 |
(as |
area2 |
(as |
display_output |
(logical) Whether to print output
in the console.
Default: |
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
.
Returns a plot and a text (string) comparing the sizes of two areas.
#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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.