Learn R Programming

CJAMP (version 0.1.1)

compute_MAF: Compute minor allele frequency of genetic variants.

Description

Function to compute the minor allele frequency (MAF) of one or more genetic variants.

Usage

compute_MAF(genodata)

Arguments

genodata

Numeric vector or dataframe containing the genetic variants in columns. Must be in allelic coding 0, 1, 2.

Value

A vector containing the minor allele frequencies of the variants.

Examples

Run this code
# NOT RUN {
# Example of a single variant
set.seed(10)
genodata <- stats::rbinom(2000, 2, 0.3)
compute_MAF(genodata)

# Example of a set of variants
genodata <- generate_genodata()
compute_MAF(genodata)

# }

Run the code above in your browser using DataLab