| Title: | Classify Points by Distance to Polygon Boundaries |
|---|---|
| Description: | Classifies spatial points relative to polygon boundaries, labeling each point as "core" (inside), "halo" (in a buffer zone), or pruning it (outside both). Handles projection, buffering, and point-in-polygon operations automatically. The default buffer produces equal core and halo areas, providing a scale-independent definition of "near the boundary." An optional mask clips the buffer to relevant areas such as coastlines. |
| Authors: | Gilles Colling [aut, cre, cph] (ORCID: <https://orcid.org/0000-0003-3070-6066>) |
| Maintainer: | Gilles Colling <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.2.5 |
| Built: | 2026-05-29 23:12:46 UTC |
| Source: | https://github.com/gcol33/areaofeffect |
Preserves aoe_result attributes when subsetting.
## S3 method for class 'aoe_result' x[i, ...]## S3 method for class 'aoe_result' x[i, ...]
x |
An aoe_result object |
i |
Row indices |
... |
Additional arguments passed to sf subsetting |
An aoe_result object (or sf if support_id removed)
Given a set of points and one or more support polygons, aoe() classifies
points as "core" (inside original support) or "halo" (inside the area of
effect but outside original support), pruning all points outside.
aoe( points, support = NULL, scale = NULL, area = NULL, method = c("buffer", "stamp"), reference = NULL, mask = NULL, largest_polygon = TRUE, coords = NULL )aoe( points, support = NULL, scale = NULL, area = NULL, method = c("buffer", "stamp"), reference = NULL, mask = NULL, largest_polygon = TRUE, coords = NULL )
points |
An |
support |
One of:
|
scale |
Numeric scale factor (default
For For Cannot be used together with |
area |
Numeric area proportion (alternative to Unlike Cannot be used together with |
method |
Method for computing the area of effect:
|
reference |
Optional If |
mask |
Optional mask for clipping the area of effect. Can be:
|
largest_polygon |
Logical (default |
coords |
Column names for coordinates when |
By default, the area of effect is computed using a buffer that produces equal core and halo areas. This means the AoE has twice the area of the original support, split evenly between core (inside) and halo (outside).
Computes a uniform buffer distance such that the buffered area
equals the target. The buffer distance is found by solving:
where is the perimeter and is the desired halo area.
Applies an affine transformation to each vertex:
where is the reference point (centroid), is each vertex,
and is the scale factor. This method preserves shape proportions
but only guarantees the AoE contains the original for star-shaped polygons
(where the centroid can "see" all boundary points).
Points exactly on the original support boundary are classified as "core".
The support geometry is validated internally using sf::st_make_valid().
An aoe_result object (extends sf) containing only the supported
points, with columns:
Original point identifier (row name or index)
Identifier for which support the classification refers to
Classification: "core" or "halo"
When multiple supports are provided, points may appear multiple times (once per support whose AoE contains them).
The result has S3 methods for print(), summary(), and plot().
Use aoe_geometry() to extract the AoE polygons.
library(sf) # Single support support <- st_as_sf( data.frame(id = 1), geometry = st_sfc(st_polygon(list( cbind(c(0, 10, 10, 0, 0), c(0, 0, 10, 10, 0)) ))), crs = 32631 ) pts <- st_as_sf( data.frame(id = 1:4), geometry = st_sfc( st_point(c(5, 5)), st_point(c(2, 2)), st_point(c(15, 5)), st_point(c(30, 30)) ), crs = 32631 ) result <- aoe(pts, support) # Multiple supports (e.g., admin regions) supports <- st_as_sf( data.frame(region = c("A", "B")), geometry = st_sfc( st_polygon(list(cbind(c(0, 10, 10, 0, 0), c(0, 0, 10, 10, 0)))), st_polygon(list(cbind(c(8, 18, 18, 8, 8), c(0, 0, 10, 10, 0)))) ), crs = 32631 ) result <- aoe(pts, supports) # Points near the boundary may appear in both regions' AoElibrary(sf) # Single support support <- st_as_sf( data.frame(id = 1), geometry = st_sfc(st_polygon(list( cbind(c(0, 10, 10, 0, 0), c(0, 0, 10, 10, 0)) ))), crs = 32631 ) pts <- st_as_sf( data.frame(id = 1:4), geometry = st_sfc( st_point(c(5, 5)), st_point(c(2, 2)), st_point(c(15, 5)), st_point(c(30, 30)) ), crs = 32631 ) result <- aoe(pts, support) # Multiple supports (e.g., admin regions) supports <- st_as_sf( data.frame(region = c("A", "B")), geometry = st_sfc( st_polygon(list(cbind(c(0, 10, 10, 0, 0), c(0, 0, 10, 10, 0)))), st_polygon(list(cbind(c(8, 18, 18, 8, 8), c(0, 0, 10, 10, 0)))) ), crs = 32631 ) result <- aoe(pts, supports) # Points near the boundary may appear in both regions' AoE
Calculate area statistics for the original supports and their areas of effect, including expansion ratios, masking effects, and core/halo balance.
aoe_area(x)aoe_area(x)
x |
An |
With scale , the AoE expands by multiplier from centroid,
resulting in times the area. The theoretical halo:core ratio
is :
Scale 1 (default): ratio 3.0 (core 1 part, halo 3 parts)
Scale 0.414: ratio 1.0 (equal areas)
Masking reduces the halo (and thus the ratio) when the AoE extends beyond hard boundaries.
An aoe_area_result data frame with one row per support:
Support identifier
Area of core region (same as original support)
Area of halo region (AoE minus core, after masking)
Total AoE area after masking
Ratio of halo to core area (theoretically 3.0 without mask)
Percentage of theoretical AoE area removed by masking
library(sf) support <- st_as_sf( data.frame(id = 1), geometry = st_sfc(st_polygon(list( cbind(c(0, 10, 10, 0, 0), c(0, 0, 10, 10, 0)) ))), crs = 32631 ) pts <- st_as_sf( data.frame(id = 1:3), geometry = st_sfc( st_point(c(5, 5)), st_point(c(15, 5)), st_point(c(2, 2)) ), crs = 32631 ) result <- aoe(pts, support) aoe_area(result)library(sf) support <- st_as_sf( data.frame(id = 1), geometry = st_sfc(st_polygon(list( cbind(c(0, 10, 10, 0, 0), c(0, 0, 10, 10, 0)) ))), crs = 32631 ) pts <- st_as_sf( data.frame(id = 1:3), geometry = st_sfc( st_point(c(5, 5)), st_point(c(15, 5)), st_point(c(2, 2)) ), crs = 32631 ) result <- aoe(pts, support) aoe_area(result)
Given a set of points and a border (line), aoe_border() classifies
points by their side relative to the border and their distance from it.
Creates equal-area buffer zones on both sides of the border.
aoe_border( points, border, width = NULL, area = NULL, halo_width = NULL, halo_area = NULL, mask = NULL, bbox = NULL, side_names = c("side_1", "side_2"), coords = NULL )aoe_border( points, border, width = NULL, area = NULL, halo_width = NULL, halo_area = NULL, mask = NULL, bbox = NULL, side_names = c("side_1", "side_2"), coords = NULL )
points |
An |
border |
An |
width |
Buffer width in meters (for projected CRS) or degrees (for
geographic CRS). Creates core zone within this distance of the border.
Cannot be used together with |
area |
Target area for each side's core zone. The function finds the
buffer width that produces this area per side. If |
halo_width |
Width of the halo zone beyond the core. If |
halo_area |
Target area for each side's halo zone. Alternative to
|
mask |
Optional mask for clipping the buffer zones. Can be:
|
bbox |
Optional bounding box to limit the study area. Can be:
|
side_names |
Character vector of length 2 naming the sides.
Default is |
coords |
Column names for coordinates when |
The function creates symmetric buffer zones around a border line:
Core zone: Points within width (or area) distance of the border
Halo zone: Points beyond core but within width + halo_width
Pruned: Points outside the halo zone (not returned)
Each zone is split by the border line to determine which side the point falls on.
When using the area parameter, the buffer width is calculated to produce
equal area on both sides of the border. With masking, the width is adjusted
so that the masked area on each side equals the target.
An aoe_border_result object (extends sf) containing classified
points with columns:
Original point identifier
Which side of the border: value from side_names
Distance class: "core" or "halo"
Points outside the study area are pruned (not returned).
library(sf) # Create a border line border <- st_as_sf( data.frame(id = 1), geometry = st_sfc(st_linestring(matrix( c(0, 0, 100, 100), ncol = 2, byrow = TRUE ))), crs = 32631 ) # Create points pts <- st_as_sf( data.frame(id = 1:6), geometry = st_sfc( st_point(c(10, 20)), # near border, side 1 st_point(c(30, 10)), # near border, side 2 st_point(c(50, 80)), # far from border, side 1 st_point(c(80, 40)), # far from border, side 2 st_point(c(5, 5)), # very close to border st_point(c(200, 200)) # outside study area ), crs = 32631 ) # Classify by distance from border result <- aoe_border(pts, border, width = 20)library(sf) # Create a border line border <- st_as_sf( data.frame(id = 1), geometry = st_sfc(st_linestring(matrix( c(0, 0, 100, 100), ncol = 2, byrow = TRUE ))), crs = 32631 ) # Create points pts <- st_as_sf( data.frame(id = 1:6), geometry = st_sfc( st_point(c(10, 20)), # near border, side 1 st_point(c(30, 10)), # near border, side 2 st_point(c(50, 80)), # far from border, side 1 st_point(c(80, 40)), # far from border, side 2 st_point(c(5, 5)), # very close to border st_point(c(200, 200)) # outside study area ), crs = 32631 ) # Classify by distance from border result <- aoe_border(pts, border, width = 20)
Expands the area of effect just enough to capture at least min_points,
subject to hard caps on expansion. This is useful when a fixed scale leaves
some supports with insufficient data for stable modelling.
aoe_expand( points, support = NULL, min_points, max_area = 2, max_dist = NULL, method = c("buffer", "stamp"), reference = NULL, mask = NULL, coords = NULL )aoe_expand( points, support = NULL, min_points, max_area = 2, max_dist = NULL, method = c("buffer", "stamp"), reference = NULL, mask = NULL, coords = NULL )
points |
An |
support |
One of:
|
min_points |
Minimum number of points to capture in the AoE. The function finds the smallest scale that includes at least this many points. |
max_area |
Maximum halo area as a proportion of the original support area.
Default is 2, meaning halo area cannot exceed twice the support area
(total AoE <= 3x original). Set to |
max_dist |
Maximum expansion distance in CRS units. For the buffer method,
this is the maximum buffer distance. For the stamp method, this is converted
to a maximum scale based on the support's characteristic radius.
Default is |
method |
Method for computing the area of effect:
|
reference |
Optional If |
mask |
Optional mask for clipping the area of effect. Can be:
|
coords |
Column names for coordinates when |
Unlike aoe(), which applies consistent geometry across all supports,
aoe_expand() adapts the scale per-support based on local point density.
Use with caution: this can make AoEs incomparable across regions with
different point densities.
For each support, binary search finds the minimum scale where point count >= min_points. The search is bounded by:
Lower: scale = 0 (core only)
Upper: minimum of max_area cap and max_dist cap
If the caps prevent reaching min_points, a warning is issued and the result uses the maximum allowed scale.
Two caps ensure AoE doesn't expand unreasonably:
max_area (relative): Limits halo area to max_area times the original.
The corresponding scale is sqrt(1 + max_area) - 1.
Default max_area = 2 means scale <= 0.732 (total area <= 3x).
max_dist (absolute): Limits expansion distance in CRS units.
For buffer method, this is the buffer distance directly.
For stamp method, converted to scale via max_dist / characteristic_radius
where characteristic_radius = sqrt(area / pi).
An aoe_result object (same as aoe()) with additional attributes:
Logical: was min_points achieved for all supports?
Use attr(result, "expansion_info") for per-support details.
Data frame with per-support expansion details: support_id, scale_used, points_captured, target_reached, cap_hit.
aoe() for fixed-scale AoE computation
library(sf) # Create a support with sparse points support <- st_as_sf( data.frame(id = 1), geometry = st_sfc(st_polygon(list( cbind(c(0, 100, 100, 0, 0), c(0, 0, 100, 100, 0)) ))), crs = 32631 ) # Points scattered around set.seed(42) pts <- st_as_sf( data.frame(id = 1:50), geometry = st_sfc(lapply(1:50, function(i) { st_point(c(runif(1, -50, 150), runif(1, -50, 150))) })), crs = 32631 ) # Expand until we have at least 20 points result <- aoe_expand(pts, support, min_points = 20) # Check expansion info attr(result, "expansion_info")library(sf) # Create a support with sparse points support <- st_as_sf( data.frame(id = 1), geometry = st_sfc(st_polygon(list( cbind(c(0, 100, 100, 0, 0), c(0, 0, 100, 100, 0)) ))), crs = 32631 ) # Points scattered around set.seed(42) pts <- st_as_sf( data.frame(id = 1:50), geometry = st_sfc(lapply(1:50, function(i) { st_point(c(runif(1, -50, 150), runif(1, -50, 150))) })), crs = 32631 ) # Expand until we have at least 20 points result <- aoe_expand(pts, support, min_points = 20) # Check expansion info attr(result, "expansion_info")
Extract the original support polygons and/or the area of effect polygons
from an aoe_result object.
aoe_geometry(x, which = c("aoe", "original", "both"), support_id = NULL)aoe_geometry(x, which = c("aoe", "original", "both"), support_id = NULL)
x |
An |
which |
Which geometry to extract: |
support_id |
Optional character or numeric vector specifying which
support(s) to extract. If |
An sf object with polygon geometries and columns:
Support identifier
"original" or "aoe"
library(sf) support <- st_as_sf( data.frame(region = c("A", "B")), geometry = st_sfc( st_polygon(list(cbind(c(0, 10, 10, 0, 0), c(0, 0, 10, 10, 0)))), st_polygon(list(cbind(c(15, 25, 25, 15, 15), c(0, 0, 10, 10, 0)))) ), crs = 32631 ) pts <- st_as_sf( data.frame(id = 1:4), geometry = st_sfc( st_point(c(5, 5)), st_point(c(12, 5)), st_point(c(20, 5)), st_point(c(27, 5)) ), crs = 32631 ) result <- aoe(pts, support) # Get AoE polygons aoe_polys <- aoe_geometry(result, "aoe") # Get both original and AoE for comparison both <- aoe_geometry(result, "both") # Filter to one support (uses row names as support_id) region_1 <- aoe_geometry(result, "aoe", support_id = "1")library(sf) support <- st_as_sf( data.frame(region = c("A", "B")), geometry = st_sfc( st_polygon(list(cbind(c(0, 10, 10, 0, 0), c(0, 0, 10, 10, 0)))), st_polygon(list(cbind(c(15, 25, 25, 15, 15), c(0, 0, 10, 10, 0)))) ), crs = 32631 ) pts <- st_as_sf( data.frame(id = 1:4), geometry = st_sfc( st_point(c(5, 5)), st_point(c(12, 5)), st_point(c(20, 5)), st_point(c(27, 5)) ), crs = 32631 ) result <- aoe(pts, support) # Get AoE polygons aoe_polys <- aoe_geometry(result, "aoe") # Get both original and AoE for comparison both <- aoe_geometry(result, "both") # Filter to one support (uses row names as support_id) region_1 <- aoe_geometry(result, "aoe", support_id = "1")
Sample points from an aoe_result with control over core/halo balance.
This is useful when core regions dominate due to point density, and you
want balanced representation for modelling.
aoe_sample(x, ...) ## Default S3 method: aoe_sample(x, ...) ## S3 method for class 'aoe_result' aoe_sample( x, n = NULL, ratio = c(core = 0.5, halo = 0.5), replace = FALSE, by = c("overall", "support"), ... )aoe_sample(x, ...) ## Default S3 method: aoe_sample(x, ...) ## S3 method for class 'aoe_result' aoe_sample( x, n = NULL, ratio = c(core = 0.5, halo = 0.5), replace = FALSE, by = c("overall", "support"), ... )
x |
An |
... |
Additional arguments passed to methods. |
n |
Total number of points to sample. If |
ratio |
Named numeric vector specifying the target proportion of core
and halo points. Must sum to 1. Default is |
replace |
Logical. Sample with replacement? Default is |
by |
Character. Stratification grouping:
|
Fixed n: When n is specified, the function samples exactly n points
(or fewer if not enough available), distributed according to ratio.
Balanced downsampling: When n is NULL, the function downsamples
the larger stratum to match the smaller one according to ratio.
For example, with ratio c(core = 0.5, halo = 0.5) and 100 core + 20 halo
points, it returns 20 core + 20 halo = 40 points.
With by = "support", sampling is done independently within each support,
then results are combined. This ensures each support contributes balanced
samples. With by = "overall", all points are pooled first.
An aoe_result object containing the sampled points, preserving
all original columns and attributes. Has additional attribute
sample_info with details about the sampling.
aoe() for computing AoE classifications
library(sf) support <- st_as_sf( data.frame(id = 1), geometry = st_sfc(st_polygon(list( cbind(c(0, 100, 100, 0, 0), c(0, 0, 100, 100, 0)) ))), crs = 32631 ) # Many points in core, few in halo set.seed(42) pts <- st_as_sf( data.frame(id = 1:60), geometry = st_sfc(c( lapply(1:50, function(i) st_point(c(runif(1, 10, 90), runif(1, 10, 90)))), lapply(1:10, function(i) st_point(c(runif(1, 110, 140), runif(1, 10, 90)))) )), crs = 32631 ) result <- aoe(pts, support, scale = 1) # Balance core/halo (downsamples core to match halo) balanced <- aoe_sample(result) # Fixed sample size with 70/30 split sampled <- aoe_sample(result, n = 20, ratio = c(core = 0.7, halo = 0.3))library(sf) support <- st_as_sf( data.frame(id = 1), geometry = st_sfc(st_polygon(list( cbind(c(0, 100, 100, 0, 0), c(0, 0, 100, 100, 0)) ))), crs = 32631 ) # Many points in core, few in halo set.seed(42) pts <- st_as_sf( data.frame(id = 1:60), geometry = st_sfc(c( lapply(1:50, function(i) st_point(c(runif(1, 10, 90), runif(1, 10, 90)))), lapply(1:10, function(i) st_point(c(runif(1, 110, 140), runif(1, 10, 90)))) )), crs = 32631 ) result <- aoe(pts, support, scale = 1) # Balance core/halo (downsamples core to match halo) balanced <- aoe_sample(result) # Fixed sample size with 70/30 split sampled <- aoe_sample(result, n = 20, ratio = c(core = 0.7, halo = 0.3))
Sample points from an aoe_border_result with control over side and/or
core/halo balance.
## S3 method for class 'aoe_border_result' aoe_sample( x, n = NULL, ratio = NULL, by = c("side", "class"), replace = FALSE, ... )## S3 method for class 'aoe_border_result' aoe_sample( x, n = NULL, ratio = NULL, by = c("side", "class"), replace = FALSE, ... )
x |
An |
n |
Total number of points to sample. If |
ratio |
Named numeric vector specifying target proportions. Names
should match the side names used in |
by |
Character. What to stratify by:
|
replace |
Logical. Sample with replacement? Default is |
... |
Additional arguments (ignored). |
An aoe_border_result object containing the sampled points.
## Not run: result <- aoe_border(pts, border, width = 1000, side_names = c("west", "east")) # Equal sampling from each side balanced <- aoe_sample(result, ratio = c(west = 0.5, east = 0.5)) # Sample by core/halo instead by_class <- aoe_sample(result, ratio = c(core = 0.5, halo = 0.5), by = "class") ## End(Not run)## Not run: result <- aoe_border(pts, border, width = 1000, side_names = c("west", "east")) # Equal sampling from each side balanced <- aoe_sample(result, ratio = c(west = 0.5, east = 0.5)) # Sample by core/halo instead by_class <- aoe_sample(result, ratio = c(core = 0.5, halo = 0.5), by = "class") ## End(Not run)
Compute summary statistics for an AoE classification result, including counts and proportions of core vs halo points per support.
aoe_summary(x)aoe_summary(x)
x |
An |
A data frame with one row per support, containing:
Support identifier
Total number of supported points
Number of core points
Number of halo points
Proportion of points that are core
Proportion of points that are halo
library(sf) support <- st_as_sf( data.frame(id = 1), geometry = st_sfc(st_polygon(list( cbind(c(0, 10, 10, 0, 0), c(0, 0, 10, 10, 0)) ))), crs = 32631 ) pts <- st_as_sf( data.frame(id = 1:4), geometry = st_sfc( st_point(c(5, 5)), st_point(c(2, 2)), st_point(c(15, 5)), st_point(c(12, 5)) ), crs = 32631 ) result <- aoe(pts, support) aoe_summary(result)library(sf) support <- st_as_sf( data.frame(id = 1), geometry = st_sfc(st_polygon(list( cbind(c(0, 10, 10, 0, 0), c(0, 0, 10, 10, 0)) ))), crs = 32631 ) pts <- st_as_sf( data.frame(id = 1:4), geometry = st_sfc( st_point(c(5, 5)), st_point(c(2, 2)), st_point(c(15, 5)), st_point(c(12, 5)) ), crs = 32631 ) result <- aoe(pts, support) aoe_summary(result)
An sf object containing country polygons from Natural Earth (1:50m scale)
with pre-calculated bounding boxes for area of effect analysis.
countriescountries
An sf data frame with 237 rows and 9 variables:
ISO 3166-1 alpha-2 country code (e.g., "FR", "BE")
ISO 3166-1 alpha-3 country code (e.g., "FRA", "BEL")
Country name
Continent name
Original bounding box (xmin, ymin, xmax, ymax) in Mollweide
AoE bounding box at scale sqrt(2)-1 (equal areas)
AoE bounding box at scale 1 (equal linear distance)
Scale factor that produces halo area = country area (with land mask)
Country polygon in WGS84 (EPSG:4326)
Natural Earth https://www.naturalearthdata.com/
# Get France france <- countries[countries$iso3 == "FRA", ] # Use directly with aoe()# Get France france <- countries[countries$iso3 == "FRA", ] # Use directly with aoe()
A named list of pre-computed halo geometries for each country where the halo area equals the country area (area proportion = 1). These halos account for land masking (sea areas excluded).
country_haloscountry_halos
A named list with ISO3 country codes as names. Each element is
either an sfc geometry (POLYGON or MULTIPOLYGON) in WGS84, or NULL
if computation failed for that country.
Each halo is a "donut" shape: the area between the original country boundary and the expanded boundary, clipped to land.
Computed from Natural Earth country polygons and land mask.
# Get France's equal-area halo france_halo <- country_halos[["FRA"]]# Get France's equal-area halo france_halo <- country_halos[["FRA"]]
Quick accessor for country polygons from the bundled dataset.
get_country(x)get_country(x)
x |
Country name, ISO2 code, or ISO3 code (case-insensitive) |
An sf object with the country polygon, or error if not found.
get_country("Belgium") get_country("BE") get_country("BEL")get_country("Belgium") get_country("BE") get_country("BEL")
An sf object containing the global land polygon from Natural Earth (1:50m scale).
Used for masking area of effect computations to exclude ocean areas.
landland
An sf data frame with 1 row:
Description ("Global Land")
Land multipolygon in WGS84 (EPSG:4326)
Natural Earth https://www.naturalearthdata.com/
# Use as mask to exclude sea dummy <- sf::st_as_sf( data.frame(id = 1), geometry = sf::st_sfc(sf::st_point(c(14.5, 47.5))), crs = 4326 ) result <- aoe(dummy, "AT", mask = land)# Use as mask to exclude sea dummy <- sf::st_as_sf( data.frame(id = 1), geometry = sf::st_sfc(sf::st_point(c(14.5, 47.5))), crs = 4326 ) result <- aoe(dummy, "AT", mask = land)
Plot method for aoe_border_result
## S3 method for class 'aoe_border_result' plot(x, ...)## S3 method for class 'aoe_border_result' plot(x, ...)
x |
An aoe_border_result object |
... |
Additional arguments passed to plot |
NULL (called for side effect)
Visualize an AoE classification result, showing points colored by class and optionally the support and AoE boundaries.
## S3 method for class 'aoe_result' plot( x, support_id = NULL, show_aoe = TRUE, show_original = TRUE, col_core = "#2E7D32", col_halo = "#F57C00", col_original = "#000000", col_aoe = "#9E9E9E", pch = 16, cex = 0.8, main = NULL, ... )## S3 method for class 'aoe_result' plot( x, support_id = NULL, show_aoe = TRUE, show_original = TRUE, col_core = "#2E7D32", col_halo = "#F57C00", col_original = "#000000", col_aoe = "#9E9E9E", pch = 16, cex = 0.8, main = NULL, ... )
x |
An aoe_result object |
support_id |
Optional: filter to specific support(s) |
show_aoe |
Logical; show AoE boundary (default TRUE) |
show_original |
Logical; show original support boundary (default TRUE) |
col_core |
Color for core points (default "#2E7D32", green) |
col_halo |
Color for halo points (default "#F57C00", orange) |
col_original |
Color for original support boundary (default "#000000") |
col_aoe |
Color for AoE boundary (default "#9E9E9E") |
pch |
Point character (default 16) |
cex |
Point size (default 0.8) |
main |
Plot title (default auto-generated) |
... |
Additional arguments passed to plot |
Invisibly returns x
library(sf) support <- st_as_sf( data.frame(id = 1), geometry = st_sfc(st_polygon(list( cbind(c(0, 10, 10, 0, 0), c(0, 0, 10, 10, 0)) ))), crs = 32631 ) set.seed(42) pts <- st_as_sf( data.frame(id = 1:50), geometry = st_sfc(lapply(1:50, function(i) { st_point(c(runif(1, -5, 15), runif(1, -5, 15))) })), crs = 32631 ) result <- aoe(pts, support) plot(result)library(sf) support <- st_as_sf( data.frame(id = 1), geometry = st_sfc(st_polygon(list( cbind(c(0, 10, 10, 0, 0), c(0, 0, 10, 10, 0)) ))), crs = 32631 ) set.seed(42) pts <- st_as_sf( data.frame(id = 1:50), geometry = st_sfc(lapply(1:50, function(i) { st_point(c(runif(1, -5, 15), runif(1, -5, 15))) })), crs = 32631 ) result <- aoe(pts, support) plot(result)
Print method for aoe_area_result
## S3 method for class 'aoe_area_result' print(x, ...)## S3 method for class 'aoe_area_result' print(x, ...)
x |
An aoe_area_result object |
... |
Additional arguments (ignored) |
Invisibly returns x
Print method for aoe_border_result
## S3 method for class 'aoe_border_result' print(x, ...)## S3 method for class 'aoe_border_result' print(x, ...)
x |
An aoe_border_result object |
... |
Additional arguments (ignored) |
Invisibly returns x
Print method for aoe_expand_result
## S3 method for class 'aoe_expand_result' print(x, ...)## S3 method for class 'aoe_expand_result' print(x, ...)
x |
An aoe_expand_result object |
... |
Additional arguments (ignored) |
Invisibly returns x
Print method for aoe_result
## S3 method for class 'aoe_result' print(x, ...)## S3 method for class 'aoe_result' print(x, ...)
x |
An aoe_result object |
... |
Additional arguments passed to print.sf |
Invisibly returns x
Print method for aoe_summary_result
## S3 method for class 'aoe_summary_result' print(x, ...)## S3 method for class 'aoe_summary_result' print(x, ...)
x |
An aoe_summary_result object |
... |
Additional arguments (ignored) |
Invisibly returns x
Summary method for aoe_result
## S3 method for class 'aoe_result' summary(object, ...)## S3 method for class 'aoe_result' summary(object, ...)
object |
An aoe_result object |
... |
Additional arguments (ignored) |
An aoe_summary_result object