F.weekly.effort: F.weekly.effort - Plot fishing and non-fishing effort.

F.weekly.effortR Documentation

F.weekly.effort - Plot fishing and non-fishing effort.

Description

Compute weekly "Fishing" and "Not fishing" hours, then plot.

Usage

F.weekly.effort(site, taxon, min.date, max.date, output.file)

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.

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.

Details

Dates provided by variables min.date and max.date cannot span more than 366 days. Additionally, the code is only set up to calculate fishing with a provided taxon of 161980, i.e., Chinook Salmon.

Function F.weekly.effort utilizes the Build Report Criteria Release and Sample Period query series to first identify appropriate fishing instances between min.date and max.date. Series Weekly Effort then massages the fishing time data into the format necessary for output. See section Structured Query Language (SQL) Queries in F.run.sqlFile for more information on query series.

Allocation of time spent fishing is to one of three possibilities. The first tabulates time during which a trap was not fishing; i.e., the trap was out of the water. The second and third summarize time for which the trap was deployed but for which fishing was unsuccessful or successful, respectively. Variable includeCatchID determines whether or not a fishing instance (identifiable via a unique trapVisitID) was successful or not.

All vertical bars in the graph cover seven calendar days, or 168 hours, with the exception of Julian week 53, which covers December 30th to December 31st in leap years, and December 31st alone in non-leap years. In this case, the "week" spans only 2 or 1 day(s), respectively. Gray coloring is used to flesh out the remaining 5 or 6 days, respectively, for this special week. In this way, all weeks cover a 7-day period within the bar-chart graphical output.

The output graph and csvs for summary fishing over all unique traps between the provided min.date and max.date calculate total minutes on a per-day basis. Thus, if three traps fished on one day, but only two the next, the program utilizes 1440*3=4320 total minutes for the first day, but only 1440*2=2880 total minutes for the second. Note there are 1440 = 24*60 minutes in one day.

Value

A png graphical display and csv of underlying data, for each unique trap with fishing data between the specified min.date and max.date. An additional png and csv is output summarizing all traps together.

Author

Trent McDonald and Jason Mitchell

See Also

F.run.sqlFile

Examples

## Not run: 
#   ---- Estimate the weekly effort on the American River for all 
#   ---- inclusive traps, from Jan. 16, 2013 through June 8, 2013.  
site <- 57000
taxon <- 161980
min.date <- "2016-01-16"
max.date <- "2013-06-08"
output.file <- "American River"
F.weekly.effort(site,taxon,min.date,max.date,output.file)

## End(Not run)

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