Learn R Programming

expp (version 1.2.5)

eppMatrix-class: Convert a data.frame to an eppMatrix object.

Description

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

Usage

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

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataLab