CKMRpop0.1.3 package

Forward-in-Time Simulation and Tallying of Pairwise Relationships

amm2tibble

convert an ancestry-matching matrix to a ggplot-able tibble

anc_match_masks

Return ancestry-matrix-zone masks for different relationship types

ancestor_abbrvs

Return a string of ancestor abbreviations in the order of the ancestor...

ancestor_vectors_cpp

Function to make a vector of all the ancestors of an individual out to...

basic_amm_plot

here is a function to plot a basic ancestry match matrix

cat_dom_relat

Categorize the dominant relationship from an ancestry match matrix

compile_related_pairs

compile pairwise relationships from the samples

count_and_plot_ancestry_matrices

Count up the number of different kinds of related pairs and make a plo...

count_and_plot_mate_distribution

Count and plot the number of mates each individuals has produced offsp...

downsample_pairs

downsample the number of individuals sampled

find_ancestors_and_relatives_of_samples

Find ancestors and relative of each sampled member of a pedigree

gg_add_generation_bands

Add bands of transparent colors to denote generations on plots of ance...

gg_add_zone_perimeters

Add perimeters around the relationship zones

ggplot_census_by_year_age_sex

Just a simple plot function

install_spip

Download the spip binary and install it where CKMRpop expects it

int_pow2

Exponentiation function for integer arguments

leslie_from_spip

Return a Leslie-like matrix from the spip parameters

pipe

Pipe operator

plot_amm_from_matrix

plot an ancestry matrix (or multiple such matrices) from its (their) m...

plot_conn_comps

plot the graph showing the connected components

prepare_for_dfs

Prepare input for the DFS relative-finding algorithm

primary_ancestor_pairs

Return a list of the indices of the primary shared ancestors

rcpp_ancestors_and_relatives

function to test and use DFS stuff

recapture_pairs

Return the recaptures from amongst the samples

relationship_zone_perimeters

Return the perimeters of all the relationship zones

relpair_conn_comps

Find connected components amongst the related pairs

run_spip

Run spip in a user-specified directory

search_down

Depth first search down the pedigree to N generations.

search_up

Depth first search up the pedigree to N generations.

slurp_spip

Read in the pedigree, census, and sampling information from the spip r...

spip_binary

file path to be used in a call to spip

spip_binary_path

return the path where spip should be in the R system paths

spip_exists

return TRUE if spip exists where it should be installed.

spip_help

print the abbreviated usage information from spip

spip_help_full

print the full usage information from spip

summarize_offspring_and_mate_numbers

Summarize the distribution of number of offspring and number of mates

summarize_survival_from_census

Summarize annual sex-and-age-specific survival rates from the census i...

uncooked_spaghetti

Summarise kin-pair information and use it to create uncooked spaghetti...

Provides an R wrapper around the program 'spip' (<https://onlinelibrary.wiley.com/doi/abs/10.1111/j.1471-8286.2005.00884.x>), a C program for the simulation of pedigrees within age-structured populations with user-specified life histories. Also includes a variety of functions to parse 'spip' output to compile information about related pairs amongst simulated, sampled individuals, to assess the feasibility and potential accuracy of close-kin mark-recapture (CKMR). Full documentation and vignettes are mirrored at <https://eriqande.github.io/CKMRpop/index.html> and can be read online there.

  • Maintainer: Eric C. Anderson
  • License: CC0
  • Last published: 2021-07-17