Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gpSampler

Randomly sample a genepop file


Description

Randomly re-samples population samples from a genepop file for user defined sizes and returns a new genepop file containing the sub-sample data. The function can easily be integrated into simulation pipelines when exploring sample size effects.

Usage

gpSampler(infile = NULL, samp_size = 10, outfile = NULL)

Arguments

infile

A character string pointing to a genepop input file. If the file exists in the current working directory, only the file name is required. If the file resides elsewhere, the entire file path is required.

samp_size

This argument specifies the number of individuals to be randomly sampled from each population sample in the input file. Either a single numeric argument can be passed or a numeric vector of length equal to the number of population samples in the genepop file.

outfile

A character string specifying the prefix name for the resulting file. This string will be suffixed with ".gen". The file will be written to the working directory, unless a properly formatted path is passed to outfile

Author(s)

Kevin Keenan


diveRsity

A Comprehensive, General Purpose Population Genetics Analysis Package

v1.9.90
GPL (>= 2)
Authors
Kevin Keenan <kkeenan02@qub.ac.uk>
Initial release
2017-03-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.