Learn R Programming

mixIndependR (version 1.0.0)

AlleleFreq: Calculate Allele Frequency

Description

Calculate Allele Frequency

Usage

AlleleFreq(x,sep)

Arguments

x

a dataset of genotypes. Each row denotes each individual; each column contain each marker.

sep

the allele separator in the imported genotype data.Note: when using the special character like "|", remember to protect it as "\|"(default).

Value

a matrix of allele frequencies. Each row denotes each allele; each column denotes each marker. The order of makers follows x.

Details

This function calculates the allele frequencies of one dataset.

Examples

Run this code
# NOT RUN {
require(mixIndependR)
x <- data.frame(STR1=c("12|12","13|14","13|13","14|15"),
               SNP1=c("A|A","T|T","A|T","A|T"))
AlleleFreq(x,"\\|")

# }

Run the code above in your browser using DataLab