eppMatrix: Convert a 'data.frame' to an eppMatrix object.

Description Usage Arguments Value Slots See Also Examples

View source: R/eppMatrix.R

Description

Converts a data.frame to a eppMatrix object using a ~male+female formula.

Usage

1
eppMatrix(data, pairs = ~male + female)

Arguments

data

a data.frame

pairs

a formula indicating the extra-pair male and the extra-pair female in that order.

Value

An object of class eppMatrix with two slots.

Slots

male

extra-pair male ID-s as character vectors

female

extra-pair female ID-s as character vectors

See Also

epp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
eppPairs = data.frame(male = c("m1", "m2", "m1"), female=c("f3", "f1", "f2") )
e = eppMatrix(eppPairs,  pairs = ~ male + female)
class(e)
showClass("eppMatrix")

data(bluetit_breeding)
data(bluetit_epp)
b = bluetit_breeding[bluetit_breeding$year_ == 2010, ]
eppPairs = bluetit_epp[bluetit_epp$year_ == 2010, ]

breedingDat  = SpatialPointsBreeding(b, id = 'id', coords = ~ x + y, breeding = ~ male + female)
eppDat = eppMatrix(eppPairs, pairs = ~ male + female)

plot(breedingDat, eppDat)

expp documentation built on June 20, 2021, 5:06 p.m.