F.plot.catch.model: F.plot.catch.model

F.plot.catch.modelR Documentation

F.plot.catch.model

Description

Plot smoothed, and possibly imputed, catch data over days per trap.

Usage

F.plot.catch.model(df, file = NA)

Arguments

df

A data frame that includes variables trapPositionID, TrapPosition, batchDate, imputed.catch, modAssignedCatch, and imputedCatch.

file

The name of the file prefix under which output is to be saved. Set to NA to plot to the Plot window.

Details

The input data frame usually has other catch variables, although these currently serve no graphical purpose. Variable trapPositionID contains the numeric code of a trap, while variable TrapPosition contains its text description. Variable imputed.catch holds the proportion of time, for that day, for which imputed occurred; as such, its values are between zero and one, inclusive. Variable imputedCatch contains the total number of imputed fish for the day recorded via batchDate. Variable modAssignedCatch contains the total number of caught fish for that batchDate and incorporates any extra fish arising from half-cone operations. The value of imputedCatch is necessarily equal to or less than the value of modAssignedCatch.

The imputation curve displayed in the graph is obtained via function supersmu, and serves as a reasonable approximation to the actual spline used in the imputation procedure contained in function F.catch.model.

Value

A png graphical display of Daily Raw (uninflated) catch, per trap, by day.

Author(s)

WEST Inc.

See Also

F.catch.model

Examples

## Not run: 
#   ---- Create a data frame.
batchDates <- as.POSIXct(strftime(seq(from=c(ISOdate(2014,1,1)),
  by="day",length.out=80),format="%F"),tz="America/Los_Angeles")
df <- data.frame(trapPositionID=c(rep(12345,80),rep(98765,80)),
                 TrapPosition=c(rep('Left Bank',80),rep('Right Bank',80)),
                 batchDate=batchDates,
                 imputed.catch=rep(0,160),
                 modAssignedCatch=20*rnorm(length(batchDates))+
                 624.26*exp(-(as.numeric(batchDates)/86400 - 16120)^2/260),
                 imputedCatch=rep(0,160))

df$modAssignedCatch <- ifelse(df$trapPositionID == 98765,
  15*rnorm(nrow(df))+0.50*df$modAssignedCatch,df$modAssignedCatch)
df$modAssignedCatch[df$modAssignedCatch < 0] <- 0
df$imputedCatch[120:124] <- df$modAssignedCatch[120:124]
df$imputed.catch[120:124] <- rep(1,5)

attr(df,"site.name") <- as.factor(c("A River in the Central Valley"))
attr(df,"species.name") <- "Chinook Salmon"
attr(df,"run.name") <- "Fall"
attr(df,"life.stage") <- "Fry"

#   ---- Plot results to plot window.
F.plot.catch.model( df, file=NA )

## End(Not run)

tmcd82070/CAMP_RST documentation built on April 6, 2022, 12:07 a.m.