makeriverdensity {riverdist} | R Documentation |
Calculate Kernel Density Using River Distance
Description
Uses spatial point data (segment and vertex) to calculate a kernel density object to use in the output class plotting method,plot.riverdensity. Scaled kernel density is calculated at approximately regularly-spaced locations, with spacing specified by the user.
If an argument is used in the survey
field, kernel densities will be
calculated for each unique value of survey
, resulting in a separate
plot for each.
The purpose of this function is to generate a kernel density object to plot using plot(), see plot.riverdensity.
Usage
makeriverdensity(
seg,
vert,
rivers,
survey = NULL,
kernel = "gaussian",
bw = NULL,
resolution = NULL
)
Arguments
seg |
A vector of river locations (segment) |
vert |
A vector of river locations (vertex) |
rivers |
The river network object to use |
survey |
A vector of survey IDs corresponding to the values of
|
kernel |
The type of density kernel to use. Allowed types are
|
bw |
The kernel bandwidth to use. If |
resolution |
The approximate spacing of the river locations used for
kernel density calculation. Accepting the default ( |
Value
A river density object, see riverdensity-class.
Note
It is likely that calculation will be very slow. Use of this function with a river network for which segment routes has not yet been calculated is not recommended.
This function is distance-computation intensive, and may be slow-running if a river network is used that does not have segment routes and/or distance lookup tables for fast distance computation. See buildsegroutes and/or buildlookup for more information.
Author(s)
Matt Tyers
See Also
plot.riverdensity, plotriverdensitypoints
Examples
data(Gulk, fakefish)
Gulk_dens <- makeriverdensity(seg=fakefish$seg, vert=fakefish$vert, rivers=Gulk,
survey=fakefish$flight.date)
# # 10 plots will be created, recommend calling par(mfrow=c(2,5))
plot(x=Gulk_dens)