Package 'kwdemog'

Title: Package for processing and exploring killer whale demographic data
Description: Generates killer whale demographic data from rows (observations) and fits preliminary models.
Authors: Eric J. Ward [aut, cre]
Maintainer: Eric J. Ward <[email protected]>
License: GPL (>=3)
Version: 1.0.3
Built: 2024-11-26 16:40:56 UTC
Source: https://github.com/noaa-nwfsc/srkw-status

Help Index


A data frame mapping Southern Resident killer whales ages and sexes to life stages

Description

A data frame mapping Southern Resident killer whales ages and sexes to life stages

Usage

ages2stages

Format

A data frame.


Function expand expands a data frame from animals as observations to animal-years as obserations

Description

Function expand expands a data frame from animals as observations to animal-years as obserations

Usage

expand(
  filename,
  start_year = 1976,
  current_year = NULL,
  fem_age_mat = 10,
  fem_age_senesc = 43,
  ages2stages = NULL
)

Arguments

filename

A file location (csv file) with births and deaths of each animal

start_year

Starting year for the expanded data, starts at 1976

current_year

End year for the expanded data, defaults to current calendar year

fem_age_mat

Female age at maturity, 10 years of age by default

fem_age_senesc

Female age at reproductive senescence, defaults to 43

ages2stages

A data frame of mapping ages and sexes to stages

Examples

## Not run: 
library(kwdemog)
data(orca)
data(ages2stages)
expanded_data = expand(orca, ages2stages = ages2stages)
# or use a filename
expanded_data = expand("use_this_file.csv", start_year = 1979, current_year = 2018,
fem_age_mat = 10, fem_age_senesc = 43, ages2stages = ages2stages)

## End(Not run)

Example census for Southern Resident killer whales

Description

Example census for Southern Resident killer whales

Usage

orca

Format

A data frame.


Function to project SRKW population in the future using individual based models

Description

Function to project SRKW population in the future using individual based models

Usage

project(
  whale_data,
  seed = 123,
  n_years = 30,
  scenarios = c("1981:2020"),
  n_iter = 200,
  verbose = FALSE,
  p_female = NA,
  n_births = NA
)

Arguments

whale_data

the expanded data frame, returned by expand()

seed

the random seed used to initialize simulations, defaults to 123

n_years

the length of the time series projections, defaults to 30 time steps

scenarios

a character string, or vector of strings describing which scenario to be run. Should be entered as a range of years separated by a colon, e.g. "1981:1985" to use rates from 1981 to 1985 or ("1981:1985","1981:2021")

n_iter

the number of iterations per scenario, defaults to 200

verbose

whether to print status updates to screen, defaults to FALSE

p_female

The probability of a female birth, defaults to the empirical value since 1980

n_births

The number of births used to calculate p_female. By default, this defaults to the empirical value observed since 1980 the probability of female birth. Larger values result in more precise estimates of p_female


A data frame containing future SRKW population projections

Description

A data frame containing future SRKW population projections

Usage

projections

Format

A data frame.


Function takes csv file and converts is to saved object

Description

Function takes csv file and converts is to saved object

Usage

writedata(filename)

Arguments

filename

A file location (csv file) with births and deaths of each animal

Examples

## Not run: 
writedata("inst/extdata/whaleData_08-06-2018.csv")

## End(Not run)