F.length.frequency: F.length.frequency - Histogram of fork lengths

F.length.frequencyR Documentation

F.length.frequency - Histogram of fork lengths

Description

Plot frequency distribution of fork lengths over life stages or by life stage

Usage

F.length.frequency(
  site,
  taxon,
  run,
  min.date,
  max.date,
  output.file,
  by.lifestage
)

Arguments

site

The identification number of the site for which estimates are required.

taxon

The species identifier indicating the type of fish of interest. This is always 161980; i.e., Chinook Salmon.

run

The run code. This is an integer value that corresponds to a run listed in table luRun which is housed inside the Access database. At the time of this writing, the luRun table translated run codes as:

  • 1 = Spring

  • 2 = Summer

  • 3 = Fall

  • 4 = Winter

  • 5 = Late fall

  • 6 = Mixed

Normally, the translation from text (e.g., "fall") to code (e.g., 3) is done by the camp interface.

min.date

The start date for data to include. This is a text string in the format %Y-%m-%d, or YYYY-MM-DD.

max.date

The end date for data to include. Same format as min.date.

output.file

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

by.lifestage

When set to TRUE, distributions are reported for individual life stages. Otherwise, they are collapsed and reported for all fish.

Value

Either a single histogram, if variable by.lifestage is set to FALSE. Otherwise, a histogram for each individual life stage present within the data.

Details

This routine compiles fish from the CAMP Access dBase using function F.get.indiv.fish.data. Fish are included from both "valid" and "invalid" trapping instances where "valid" means includeCatchID = TRUE. Thus, resulting graphs can display both valid and invalid fishing instances if both types of trapping instances took place between min.date and max.date.

Observations in the output graph are jittered slightly when plotted to show the number of measurements on each date.

When no valid catch records are found, a blank png is returned.

Author

Trent McDonald and Jason Mitchell

See Also

F.get.indiv.fish.data

Examples

## Not run: 
#   ---- Obtain graphical histograms for the American. 
site <- 57000
taxon <- 161980
run <- 3
min.date <- "2014-01-01"
max.date <- "2014-06-06"
output.file <- "American"
by.lifestage <- TRUE

F.length.frequency(site,taxon,run,min.date,max.date,output.file,by.lifestage)

# Testing on Trent's local machine
db.file <- file.path("C:/Users/trent/Documents/Projects/1200-RSTPlatform/ThePlatform",
         "CAMP_RST20220103-campR2.0.14/Data/TestingDBs/newStanislausCAMP_20Sept2018/CAMP.mdb")
output.file <- file.path("C:/Users/trent/Documents/Projects/1200-RSTPlatform/ThePlatform",
         "CAMP_RST20220103-campR2.0.14/Outputs/length.frequency_ST004X_2022-03-21_14-33-45")
F.length.frequency(site,taxon,run,min.date,max.date,output.file,FALSE)
output.file <- paste0(output.file, "_lstage")
F.length.frequency(site,taxon,run,min.date,max.date,output.file,TRUE)
         

## End(Not run)

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