| F.plot.catch.model | R Documentation |
Plot smoothed, and possibly imputed, catch data over days per trap.
F.plot.catch.model(df, file = NA)
df |
A data frame that includes variables |
file |
The name of the file prefix under which output is to be saved.
Set to |
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.
A png graphical display of Daily Raw (uninflated) catch, per
trap, by day.
WEST Inc.
F.catch.model
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.