Learn R Programming

expp (version 1.1)

eppMatrix: 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:

Object of class "character": extra-pair male ID

female:

Object of class "character":extra-pair female ID

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