make_target_date_custom_df: Create a data frame with year-long intervals given start and...

View source: R/SR-related.R

make_target_date_custom_dfR Documentation

Create a data frame with year-long intervals given start and end date, and backwards.

Description

Create a data frame with year-long intervals given start and end date, and backwards.

Usage

make_target_date_custom_df(
  target_df,
  babase,
  members_l,
  window_shift = 0,
  window_length = 1,
  .by_grp = TRUE,
  .adults_only = TRUE,
  .early_life = FALSE,
  .cumulative_adult_life = F
)

Arguments

target_df

A data frame that includes the columns sname, sex, grp, and date

babase

A DBI connection to the babase database

members_l

A subset of members table produced by the function 'subset_members'

window_shift

Length in years of the time shift for the social index. i.e. 1: 2-1 years prior

window_length

Length in years of the time window for the social index

.by_grp

Logical indicating whether to separate by group. Default is TRUE

.adults_only

Logical indicating whether to include adults only. Default is TRUE

.early_life

Logical indicating whether to calculate early life: birth - rnk/mature date, default is FALSE

.cumulative_adult_life

Logical indicating whether to calculate adult life: rnk/mature date - darting date, default is FALSE

Value

A tibble with one row per animal (and optionally, per group) and target date, with contextual data


lycium0605/SHfunction documentation built on Feb. 5, 2023, 11:14 a.m.