Learn R Programming

fecR (version 0.0.2)

calc_fishing_days_trip: Calculate fishing days for a fishing trip.

Description

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

Usage

calc_fishing_days_trip(trip)

Arguments

trip

Data.frame of the trip data

Value

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

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). Fishing days is reported at the gear (type and mesh size), fishing area, economic zone and rectangle level. Passive and active gears are treated separately. For active gears, each fishing date has 1 fishing day that is spread equally over the active gears. For passive gears, each use of a passive gear is one fishing day, i.e. on fishing date can have several passive fishing days simultaneously. 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
)
fd <- calc_fishing_days_trip(trip1)
# }

Run the code above in your browser using DataLab