check_data {inbreedR} | R Documentation |
Checks the data for consistency with the inbreedR working format.
Description
The inbreedR
working format is an i * l genotype matrix, whereby each individual is a row
and each column is a locus.
Heterozygosity at a given locus should be coded as 1
, homozygosity as 0
and missing values
should be coded as NA
.
Usage
check_data(genotypes, num_ind = NULL, num_loci = NULL)
Arguments
genotypes |
|
num_ind |
Number of individuals |
num_loci |
Number of loci / markers |
Details
Checks that (1) the genotype data just contains 3 elements, which is 0
for homozygote,
1
for heterozygote and NA
for missing data, (2) the number
of individuals corresponds to the number of rows and the number of loci corresponds to the
number of columns, (3) the data type is numeric.
.
Value
TRUE if the data format is correct, error message if any test failed
Author(s)
Martin A. Stoffel (martin.adam.stoffel@gmail.com)
Examples
data(mouse_msats)
# tranform raw genotypes into 0/1 format
genotypes <- convert_raw(mouse_msats)
# check data
check_data(genotypes, num_ind = 36, num_loci = 12)