frequencies: Get allele frequencies

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Get allele frequencies

Usage

1
frequencies(x, ms, als = NULL)

Arguments

x

a freqt object

ms

a marker or marker vector

als

an allele or allele vector. If none is provided all relevant alleles will be returned for the selected markers.

Value

depending on the number of alleles provided a single number or a data frame is returned with the request allele frequencies

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# a single marker and allele returns a number
frequencies(ft_popstr_europe, "FGA", 23)

# multiple alleles result in a data.frame
frequencies(ft_popstr_europe, "FGA", c(6, 23, 7, 23.2))

# multiple markers and alleles also result in a data.frame
frequencies(ft_popstr_europe, c("CSF1PO", "FGA"), c(6, 23, 7, 23.2))

# if alleles are not specified then every non-zero frequency is returned
frequencies(ft_popstr_europe, "FGA")

# similarly, if multiple markers are provided any allele
# with a non-zero frequency in any of the markers is returned
frequencies(ft_popstr_europe, c("CSF1PO", "FGA"))

knifecake/fafreqs documentation built on March 13, 2020, 11:53 p.m.