Learn R Programming

diveRsity (version 1.9.89)

chiCalc: Testing sample independence from genotype counts

Description

chiCalc carries out Fisher's exact tests of sample independence using genotype data.

Usage

chiCalc(infile = NULL, outfile = NULL, pairwise = FALSE, mcRep = 2000)

Arguments

infile
A character string indicating the location and name of a genepop format file to be read. If the file is in the current working directory, only the name must be provided. If the file is in a directory other than the current working directory, either a relative or absolute path to the file must be provided. The genepop file can be in the 2-digit or 3-digit allele format.
outfile
A character string indicating the prefix to be added to the results directory created. All results files will be written to this directory.
pairwise
A logical argument indicating whether sample independence should be tested between all population pairs.
mcRep
An integer specifying the number Monte Carlo test replicates. See ?fisher.test for more information.

Value

Details

All results will be written to a user defined folder ("working_directory/outfile"), providing an argument is passed for 'outfile'. Otherwise, results will only be returned to the workspace.

Fisher's exact tests are carried out using the function fisher.test. Multilocus p values are calculated using Fisher's method for combining p value.

Examples

Run this code
## Not run: 
# # To run an example use the following format
# library(diveRsity)
# data(Test_data)
# test_results <- chiCalc(infile = Test_data, outfile = NULL,
#                         pairwise = TRUE, mcRep = 5000)
# ## End(Not run)

Run the code above in your browser using DataLab