mmmTags: Prepare Tag Data

Description Usage Arguments Details Value Examples

Description

Prepare tag release and recovery data prior to fitting a Markov movement model via mmmFit().

Usage

1
2
3
4
5
6
7
8
9
mmmTags(
  x,
  y,
  cols = NULL,
  groups = NULL,
  step = NULL,
  limits = NULL,
  days_liberty = NULL
)

Arguments

x

data.frame() Tag release data. See details.

y

data.frame() Tag recovery data. See details.

cols

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

groups

list() Named list of atomic vectors. See details.

step

character() One of year, month, or day.

limits

character() Start and end dates as "%Y-%M-%D" character strings.

days_liberty

integer() Minimum number of days at liberty.

Details

The x & y arguments must be data frames that contain certain columns that have the same column name in both data frames. Both x & y must include:

In addition, y must include:

Optionally, both x & y can include:

Note that character() columns in "%Y-%M-%D" format may be substituted for Date() columns.

The cols argument is a list() of named elements. The elements must be character() string names of columns in x or y. There must be one element for each of the required element names (except as noted):

The groups argument is a list() of named elements. The elements must be atomic vectors that include all values included in each named group. All element vectors must be of the same type. The names of the element vectors must be unique. For groups to have any effect, the element group in argument cols must name a column in both x & y that has values include in the element vectors in groups.

Value

A list object of class mmmTags.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
x <- data.frame(
  Release_Date = c("2010-06-01", "2015-04-01", "2018-06-01", "2019-06-01"),
  Release_Area = c(1,1,1,1),
  Release_Group = c("F", "F", "F", "M"),
  ID = c("TAG001", "TAG002", "TAG003", "TAG004"))
y <- data.frame(
  Release_Date = c("2010-06-01", "2018-06-01", "2019-06-01"),
  Release_Area = c(1,1,1),
  Release_Group = c("F", "F", "M"),
  Recover_Date = c("2013-08-01", "2020-01-01", "2020-08-01"),
  Recover_Area = c(1,2,1),
  ID = c("TAG001", "TAG003", "TAG004"))
cols <- list(
  release_date = "Release_Date",
  release_area = "Release_Area",
  recover_date = "Recover_Date",
  recover_area = "Recover_Area",
  group = "Release_Group",
  id = "ID")
groups <- list(m = "M", f = "F")
step <- "year"
limits <- c("2010-01-01", "2020-12-31")
days_liberty <- 0L

tags <- mmmTags(x, y, cols, groups, step, limits, days_liberty)

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