app.pairs: Relatedness between pairs

Description Usage Arguments Value Author(s) See Also Examples

View source: R/app_pairs.r

Description

Extract given pairs from relatedness matrix and apply given function

Usage

1
 app.pairs(app, pairs, FUN=identity) 

Arguments

app

Relatedness matrix

pairs

Vector or matrix defining wanted pairs or a list of such elements

FUN

Function to apply to relatedness of given pairs. Argument function must be a vector.

Value

Result value of FUN function for relatedness between given pairs.

Author(s)

Claire Dandine-Roulland

See Also

app.unpairs

Examples

1
2
3
4
5
6
7
8
# load chr2 data set (~10k SNPs in low LD)
x <- read.bed.matrix( system.file("extdata", "chr2.bed", package="gaston") )

# Compute Rousset Relationship Matrix
K <- Rousset(x)$Rousset

# Compute mean of relatedness between individuals from similar population
app.pairs(K, x@ped$population, FUN=mean)

genostats/gaston.pop documentation built on Jan. 17, 2022, 10:58 a.m.