individuals2strata: Create a strata file from a list of individuals

individuals2strataR Documentation

Create a strata file from a list of individuals

Description

If your individuals have a consistent naming scheme (e.g. SPECIES-POPULATION-MATURITY-YEAR-ID = CHI-QUE-ADU-2014-020), use this function to rapidly create a strata file. Several functions in radiator and assigner requires a strata argument, i.e. a data frame with the individuals and associated groupings. If you have already run stacks on your data, the strata file is similar to a stacks 'population map file', make sure you have the required column names (INDIVIDUALS and STRATA).

Usage

individuals2strata(data, strata.start, strata.end, filename = NULL)

Arguments

data

A file or data frame object with individuals in a column. The column name is INDIVIDUALS.

strata.start

(integer) The start of your strata id. See details for more info.

strata.end

(integer) The end of your strata id. See details for more info.

filename

(optional) The file name for the strata object if you want to save it in the working directory. Default: filename = NULL, the starta object is in the global environment only (i.e. not written in the working directory).

Details

strata.start and strata.end The info must be found within the name of your individual sample. If not, you'll have to create a strata file by hand, the old fashion way. e.g. if your individuals are identified in this form : SPECIES-POPULATION-MATURITY-YEAR-ID = CHI-QUE-ADU-2014-020, then, to have the population id in the STRATA column, strata.start = 5 and strata.end = 7. The STRATA column can be any hierarchical grouping.

Value

a strata object and file, if requested. The file is tab delimited with 2 columns named: INDIVIDUALS and STRATA. The STRATA column can be any hierarchical grouping.

Author(s)

Thierry Gosselin thierrygosselin@icloud.com

See Also

read_strata, summary_strata, change_pop_names, join_strata, generate_strata

Examples

## Not run: 
strata.abalone <- individuals2strata(
data = "individuals.abalone.tsv",
strata.start = 5,
strata.end = 7,
filename = "strata.abalone.tsv"
)

## End(Not run)

thierrygosselin/radiator documentation built on May 5, 2024, 5:12 a.m.