SpatialPointsBreeding: Converts a 'data.frame' to an object of class...

Description Usage Arguments See Also Examples

View source: R/SpatialPointsBreeding.R

Description

Converts a data.frame to a SpatialPointsBreeding object. The SpatialPointsBreeding class extends SpatialPointsDataFrame with three extra slots defining the id (i.e. nest or breeding box) and the pair identity (i.e. male and female), respectively.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
SpatialPointsBreeding(
  data,
  proj4string,
  coords = ~x + y,
  breeding = ~male + female,
  id
)

## S4 method for signature 'SpatialPointsBreeding,missing'
plot(
  x,
  pch = 20,
  axes = FALSE,
  add = FALSE,
  xlim = NULL,
  ylim = NULL,
  ...,
  cex = 1,
  col = "grey",
  lwd = 1,
  bg = "grey90"
)

## S4 method for signature 'SpatialPointsBreeding,eppMatrix'
plot(
  x,
  y,
  pch = 20,
  axes = FALSE,
  add = FALSE,
  xlim = NULL,
  ylim = NULL,
  ...,
  cex = 1,
  col = "grey",
  col.epp = "red",
  lwd = 1,
  lty = 2,
  bg = "grey90"
)

Arguments

data

a data.frame containing the coordinates (e.g. "x","y"), the location id, and the pair identity (e.g. "male", "female") together with any other optional variables (e.g. individuals or nest traits).

proj4string

A CRS object containing a valid proj4 string. See CRS proj4string for details.

coords

Formula specifying which columns in object are the spatial coordinates. Argument passed to coordinates

breeding

One side formula defining the male and female ID in that order (e.g. ~ male + female)

id

Integer specifying the location id (e.g. nest box number, den ID).

x

a SpatialPointsBreeding object

pch

see plot.default

axes

see plot.default

add

see plot.default

xlim

see plot.default

ylim

see plot.default

...

further arguments to pass to plot(as(x, "Spatial")

cex

see plot.default

col

see plot.default

lwd

see plot.default

bg

see plot.default

y

an eppMatrix object

col.epp

extra-pair partners color

lty

see plot.default

See Also

epp

Examples

1
2
3
4
5
6
7
8
9
d = data.frame(
  x = c(4, 17, 16, 41, 41, 43, 86, 62, 71, 92, 95,53, 34, 27, 53), 
  y = c(3, 18, 36, 6, 18, 50, 3, 21, 40, 43, 57, 62, 62, 45, 37), 
  id = 1:15,male = paste0('m', 1:15), female = paste0('f', 1:15), 
    stringsAsFactors = FALSE)

b = SpatialPointsBreeding(d, id = 'id', breeding = ~ male+female)    

plot(b)

mpio-be/expp documentation built on June 23, 2021, 1:08 p.m.