Learn R Programming

fecR (version 0.0.2)

calc_days_at_sea_trip: Calculate days at sea for a fishing trip.

Description

Calculate days at sea for a single fishing trip using data in the format described in the package vignette checking_data.

Usage

calc_days_at_sea_trip(trip)

Arguments

trip

Data.frame of the trip data

Value

A data.frame with the days at sea by gear, fishing area and economic zone.

Details

The input is a single fishing trip. The format of the data should be checked by check_format before calling this function (see the package vignette checking_data for more details). Days at sea is reported at the gear (type and mesh size), fishing area and economic zone level. The total number of days at sea is the number of commenced 24 hour periods. The total number of days at sea of a trip is split equally over dates on which fishing occurs. The effort for each fishing date is split equally over the fishing activity on that date. Active and passive gears are treated equally. See the vignette calculating_fishing_effort for more details. This function is called by calc_fishing_effort.

See Also

See calc_fishing_effort. See the package vignette checking_data for data preparation and the vignette calculating_fishing_effort for the calculation details.

Examples

Run this code
# NOT RUN {
trip1 <- data.frame(
   eunr_id = "my_boat", loa = 2000, gt = 70, kw = 400,
   trip_id = "trip1",
   # 4 day trip
   depdate = "20140718", deptime = "0615", retdate = "20140721", rettime = "1615",
   # Only fish on 2 of those
   fishdate = c("20140719", "20140719", "20140719", "20140719", "20140720",
       "20140720", "20140720"), 
   gear = c("OTB","OTB","OTB","GN","OTB","GN","FPO"), gear_mesh_size = c(80,80,80,50,80,50,0),
   fishing_area = "27.4.B",
   economic_zone = "EU",
   rectangle = c("39F0","40F0","41F0","41F0","41F0","41F0","41F0"),
   stringsAsFactors = FALSE
)
das <- calc_days_at_sea_trip(trip1)
# }

Run the code above in your browser using DataLab