Skip to contents

This function takes a dataframe of repeated redd observations over time and converts them into a format suitable for modeling redd survival.

Usage

MakeReddSurvival(
  streamvast,
  redds,
  redd.ids = "redd_name_txt",
  redd.crs = "wgs84",
  redd.coords = c("lon", "lat"),
  survey.tol = 250,
  redd.status = "redd_status_code",
  min.surveys = 1,
  buffer = 14
)

Arguments

streamvast

A streamvast object with reachdata, countdata, and surveydata

redds

a dataframe containing observations of redds in each row

redd.ids

character; the name of the column with consistent id for each read over time

redd.crs

a crs for the redds

redd.coords

A vector of length 2 with the names of the columns for longitude and latitude

survey.tol

numeric; a max tolerance for matching redds to survey lines

redd.status

character; the name of the column with redd status (should use NR, SV, NV coding)

min.surveys

A minimum number of surveys for observations of a reach to be included

buffer

A number of days to be added to redds found on the first or last day of a season

Value

a dataframe formated for use with INLA survival models