View source: R/apps_of_direction.R
| upstreamseq | R Documentation | 
Returns a matrix of distance with direction by unique fish between sequential surveys. The mouth (lowest point) segment and vertex must be specified (see setmouth). A plotting method is provided for the output; see plotseq.
upstreamseq(
  unique,
  survey,
  seg,
  vert,
  rivers,
  logical = NULL,
  flowconnected = FALSE,
  net = FALSE,
  stopiferror = TRUE,
  algorithm = NULL
)
| unique | A vector of 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. | 
| logical | A boolean vector that can be used for subsetting - if used,
 | 
| flowconnected | If  | 
| net | Whether to calculate net upstream distance (net=TRUE) or total distance (net=FALSE, default). | 
| stopiferror | Whether or not to exit with an error if a route cannot be
found.  If this is set to  | 
| algorithm | Which route detection algorithm to use ( | 
A data frame of upstream distances (numeric), with rows defined by unique fish and columns defined by observation increment (1 to 2, 2 to 3, etc.) See upstream for additional information.
Returns either net upstream distance (net=TRUE) or total distance (net=FALSE, default). See upstream.
Building routes from the river mouth to each river network segment and/or distance lookup tables will greatly reduce computation time (see buildsegroutes).
Matt Tyers
upstream, plotseq
data(Gulk, fakefish)
# Mouth must be specified
Gulk$mouth$mouth.seg <- 1
Gulk$mouth$mouth.vert <- 1
upstreamseq(unique=fakefish$fish.id, survey=fakefish$flight, seg=fakefish$seg,
      vert=fakefish$vert, rivers=Gulk)
seqbysurvey <- upstreamseq(unique=fakefish$fish.id, survey=fakefish$flight.date, seg=fakefish$seg,
      vert=fakefish$vert, rivers=Gulk)
seqbysurvey
plotseq(seqbysurvey)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.