mmmRates: Prepare Rate Data

Description Usage Arguments Details Value Examples

Description

Prepare fishing mortality or tag reporting rate data prior to fitting a Markov movement model via mmmFit().

Usage

1
mmmRates(x, cols, reps = 1, lims = NULL, areas = NULL, inst = FALSE)

Arguments

x

data.frame() Dates, areas, and rates data. See details.

cols

list() Named list of character strings. See details.

reps

integer() Number of tag time steps per rate time step (rows).

lims

integer() First and last date (implemented as integer for now).

areas

list() Named list of area values in index order. See details.

inst

logical() Is the rate an instantaneous rate?

Details

The rate time step may differ from tag time step, as long as the tag time step is a multiple of the rate time step.

The x argument must be data frames that contains:

The cols argument is a list() of named elements. The elements must be character() string names of columns in x. There must be one element for each required element name:

The areas argument is a list() of named atomic() elements. The elements must correspond to elements in the area column of x. The elements must be in the same order in which the areas are to be indexed. The areas argument is optional if areas are already indexed sequentially from one in x.

Value

A matrix of class mmmRates.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# One tag time step per row
d <- rep(2010:2016, 3)
a <- rep(c(1,2,3), each = 7)
r <- rep(seq(0.1, 0.7, length.out = 7), 3)
x <- data.frame(d = d, a = a, r = r)
cols <- list(date = "d", area = "a", rate = "r")
r1 <- mmmRates(x, cols)

# Twelve tag time steps per row (e.g. monthly tags, yearly rates)
d <- rep(2010:2016, 3)
a <- rep(c(1,2,3), each = 7)
r <- rep(seq(0.1, 0.7, length.out = 7), 3)
x <- data.frame(d = d, a = a, r = r)
cols <- list(date = "d", area = "a", rate = "r")
reps <- 12
lims <- c(2010, 2016)
r2 <- mmmRates(x, cols, reps, lims, inst = TRUE)

luke-a-rogers/mmmTMB documentation built on Jan. 16, 2021, 3:53 p.m.