expp (version 1.2.4)

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

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

SpatialPointsBreeding(data, proj4string, coords = ~x + y,
  breeding = ~male + female, id)

# S4 method for 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 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

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


# }

Run the code above in your browser using DataCamp Workspace