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 |
A data frame mapping Southern Resident killer whales ages and sexes to life stages
ages2stages
ages2stages
A data frame.
Function expand expands a data frame from animals as observations to animal-years as obserations
expand( filename, start_year = 1976, current_year = NULL, fem_age_mat = 10, fem_age_senesc = 43, ages2stages = NULL )
expand( filename, start_year = 1976, current_year = NULL, fem_age_mat = 10, fem_age_senesc = 43, ages2stages = NULL )
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 |
## 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)
## 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
orca
orca
A data frame.
Function to project SRKW population in the future using individual based models
project( whale_data, seed = 123, n_years = 30, scenarios = c("1981:2020"), n_iter = 200, verbose = FALSE, p_female = NA, n_births = NA )
project( whale_data, seed = 123, n_years = 30, scenarios = c("1981:2020"), n_iter = 200, verbose = FALSE, p_female = NA, n_births = NA )
whale_data |
the expanded data frame, returned by |
seed |
the random seed used to initialize simulations, defaults to |
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 |
A data frame containing future SRKW population projections
projections
projections
A data frame.
Function takes csv file and converts is to saved object
writedata(filename)
writedata(filename)
filename |
A file location (csv file) with births and deaths of each animal |
## Not run: writedata("inst/extdata/whaleData_08-06-2018.csv") ## End(Not run)
## Not run: writedata("inst/extdata/whaleData_08-06-2018.csv") ## End(Not run)