matbysurveylist {riverdist} | R Documentation |
Generate List of Distance Matrix Between Observations, for All Individuals
Description
Returns a list of matrices, each giving the river distance, direction, or upstream travel distance between all observations of one unique fish. This function is principally intended for producing an object to plot in plotmatbysurveylist.
Usage
matbysurveylist(
unique,
survey,
seg,
vert,
rivers,
indiv = NULL,
method = "upstream",
flowconnected = FALSE,
net = FALSE,
stopiferror = TRUE,
algorithm = NULL
)
Arguments
unique |
A vector of unique identifiers for each fish. |
survey |
A vector of identifiers for each survey. It is recommended to use a numeric or date format (see as.Date) to preserve survey order. |
seg |
A vector of river locations (segment component). |
vert |
A vector of river locations (vertex component). |
rivers |
The river network object to use. |
indiv |
A vector of unique individuals to use. Accepting the default ( |
method |
Which general method to use. Setting |
flowconnected |
Optional parameter to pass to the distance or direction calculation. Defaults to |
net |
Optional parameter to pass to the distance or direction calculation. Defaults to |
stopiferror |
Optional parameter to pass to the distance or direction calculation. Defaults to |
algorithm |
Optional parameter to pass to the distance or direction calculation. Defaults to |
Value
A list with each element corresponding to a unique fish. Each list element is the output from either riverdistancematbysurvey, riverdirectionmatbysurvey, or upstreammatbysurvey.
Note
Building routes from the river mouth to each river network segment and/or distance lookup tables will greatly reduce computation time (see buildsegroutes).
Author(s)
Matt Tyers
See Also
riverdistance, riverdirection, upstream, riverdistancematbysurvey, riverdirectionmatbysurvey, upstreammatbysurvey, plotmatbysurveylist
Examples
data(Gulk, smallset)
matbysurveylist <- matbysurveylist(unique=smallset$id, survey=smallset$flight, seg=smallset$seg,
vert=smallset$vert, rivers=Gulk)
plotmatbysurveylist(matbysurveylist)
plotmatbysurveylist(matbysurveylist,type="confint")
plotmatbysurveylist(matbysurveylist,type="dotplot")
data(fakefish)
# matbysurveylist <- matbysurveylist(unique=fakefish$fish.id, survey=fakefish$flight,
# seg=fakefish$seg, vert=fakefish$vert, rivers=Gulk)
# plotmatbysurveylist(matbysurveylist)