Learn R Programming

riverdist (version 0.16.3)

plotseq: Plot Sequence of Observations

Description

Plots the sequence of observations or movements of each individual (given as segment and vertex). This function is primarily intended for use with mouthdistbysurvey, but will also work with riverdistanceseq and upstreamseq.

Usage

plotseq(
  seqbysurvey,
  type = "boxplot",
  xlab = "",
  ylab = "",
  main = "",
  cex.axisX = 0.8,
  lowerbound = NULL,
  upperbound = NULL,
  boundtype = "negative",
  surveysareDates = F,
  ...
)

Arguments

seqbysurvey

A matrix returned from mouthdistbysurvey, riverdistanceseq, or upstreamseq.

type

The type of plot to generate. Options are "boxplot","dotplot","boxline",or "dotline". Defaults to "boxplot".

xlab

X-axis label

ylab

Y-axis label

main

Plot title

cex.axisX

Character expansion factor for X-axis labels

lowerbound

An optional vector of lower survey bounds

upperbound

An optional vector of upper survey bounds

boundtype

Method of plotting survey bounds. Options are "positive", "negative" (default), and "lines".

surveysareDates

If surveys are in Date format (see as.Date), a value of TRUE allows the x-coordinates points to be spaced apart according to date, not equidistantly. Defaults to FALSE. Any formatting of the survey variable must be done within the original call to mouthdistbysurvey, riverdistanceseq, or upstreamseq. Dates must already be formatted as dates, or in the form "YYYY-MM-DD" or "YYYY/MM/DD".

...

Additional plotting parameters

Author

Matt Tyers

Examples

Run this code
data(Gulk, fakefish)

x <- mouthdistbysurvey(unique=fakefish$fish.id, survey=fakefish$flight.date, 
    seg=fakefish$seg, vert=fakefish$vert, rivers=Gulk)
    
plotseq(seqbysurvey=x)
plotseq(seqbysurvey=x, type="boxline")
plotseq(seqbysurvey=x, type="dotplot")
plotseq(seqbysurvey=x, type="dotline")

plotseq(seqbysurvey=x, type="dotline", surveysareDates=TRUE)

from_upstreamseq <- upstreamseq(unique=fakefish$fish.id, 
   survey=fakefish$flight, seg=fakefish$seg, vert=fakefish$vert, 
   rivers=Gulk)
plotseq(seqbysurvey=from_upstreamseq)

Run the code above in your browser using DataLab