plot_zoi1d | R Documentation |
Plots the functions to represent the zone of influence (ZOI) in 1 dimensional space, for illustration.
When there is more than one value for points
(the location of infrastructure
or sources of disturbance), two metrics might be plotted: the ZOI of the nearest feature or the
cumulative ZOI. The ZOI of the nearest feature corresponds to the maximum ZOI value from all
infrastructure at each position. The cumulative ZOI corresponds to the sum of the ZOI
of all infrastructure at each position.
plot_zoi1d(
points,
radius,
fun = exp_decay,
zoi_metric = c("nearest", "cumulative")[1],
range_plot = c(0, 12),
step = 0.01,
na.rm = TRUE,
return_df = FALSE,
...
)
points |
|
radius |
|
fun |
|
zoi_metric |
|
range_plot |
|
step |
|
na.rm |
|
return_df |
|
... |
Additional parameters passed to the ZOI decay function |
In practice, the plot_zoi1d()
computes the ZOI value for each feature
whose locations in 1 dimension are defined by points
and calculates the maximum
(ZOI of the nearest) or sum (cumulative ZOI) of all values. This is done
for a series of points in 1 dimensional space in the range range_plot
(with
steps defined by step
) and plotted.
To add: options for normalization, prob etc.
A ggplot
object with the nearest or cumulative influence plot.
If return_df = TRUE
, it returns a list with the ggplot
object and a data.frame
with
values for x
(position in 1d space) and y
(ZOI value).
# one point, exponential decay
plot_zoi1d(0, radius = 3, zoi_limit = 0.05,
fun = exp_decay, range_plot = c(0, 5), zoi_metric = "nearest")
# exponential decay
points <- c(0, 4.5, 7, 7.5)
plot_zoi1d(points, radius = 3, fun = exp_decay, range_plot = c(0, 12),
zoi_metric = "nearest")
plot_zoi1d(points, radius = 3, fun = exp_decay, range_plot = c(0, 12),
zoi_metric = "cumulative")
# threshold
plot_zoi1d(points, radius = 3, fun = threshold_decay, range_plot = c(0, 12),
zoi_metric = "nearest")
plot_zoi1d(points, radius = 3, fun = "step_decay", range_plot = c(0, 12),
zoi_metric = "cumulative")
# linear
plot_zoi1d(points, radius = 3, fun = bartlett_decay, range_plot = c(0, 12),
zoi_metric = "nearest")
plot_zoi1d(points, radius = 3, fun = "linear_decay", range_plot = c(0, 12),
zoi_metric = "cumulative")
# gaussian
plot_zoi1d(points, radius = 3, fun = gaussian_decay, range_plot = c(0, 12),
zoi_metric = "nearest")
plot_zoi1d(points, radius = 3, fun = "half_norm_decay", range_plot = c(0, 12),
zoi_metric = "cumulative", return_df = TRUE) # also return the data.frame
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.