check_times: Check that start, wait, or end times for a surveyor are...

View source: R/check_times.R

check_timesR Documentation

Check that start, wait, or end times for a surveyor are provided and reasonable

Description

This is a helper function used in get_total_value to check that surveyor for start_time, wait_time, end_time, and fishing_day_length are valid.

Usage

check_times(
  start_time = NULL,
  wait_time = NULL,
  end_time = NULL,
  fishing_day_length = NULL
)

Arguments

start_time

The start time of the clerk. An int between 0 and fishing_day_length. The default is NULL.

wait_time

the wait time of the clerk. The default is NULL. The default is NULL

end_time

the end time of the clerk. An int between 0 and fishing_day_length. The default is NULL.

fishing_day_length

the total length of the fishing day, in hours, as int. 0800hrs to 2000hrs = fishing_day_length of 12 hours.

Details

Two of the three start_time, wait_time, or end_time must be provided. The third will be calculated.

Author(s)

Steven H. Ranney

Examples

library(dplyr)   
set.seed(256)

start_time <- NULL
end_time <- NULL
wait_time <- NULL

# Will return error
## Not run: check_times(start_time = start_time, end_time = end_time, wait_time = wait_time, 
fishing_day_length = 12)
## End(Not run)

start_time <- 2
end_time <- NULL
wait_time <- NULL

# Will return an error
## Not run: check_times(start_time = start_time, end_time = end_time, wait_time = wait_time, 
fishing_day_length = 8)
## End(Not run)

start_time <- 2
end_time <- 6
wait_time <- NULL
fishing_day_length <- 8

check_times(start_time = start_time, end_time = end_time, wait_time = wait_time, 
fishing_day_length = 8)
                   

stevenranney/AnglerCreelSurveySimulation documentation built on May 28, 2024, 7:34 p.m.