mcp.rast {adehabitat} | R Documentation

## Converts a Polygon to Raster

### Description

`mcp.rast` converts a polygon map to a raster map of class `asc`.

### Usage

      mcp.rast(poly, w)

### Arguments

`poly` | a data frame with 2 columns giving the coordinates of a polygon object
`w` | an object of class `kasc`, or of class `asc`

### Value

Returns an object of class `asc`.

### Author(s)

Clément Calenge calenge@biomserv.univ-lyon1.fr

### See Also

`hr.rast`

### Examples

    data(puechabon)
    toto <- puechabon$kasc
    loc <- puechabon$locs

    ## gets the coordinates of the relocations for the wild boar #1
    wb1 <- loc[loc$Name == "Chou",]
    wb1 <- cbind(wb1$X, wb1$Y)
    nbpol <- chull(wb1)
    xycoord <- wb1[nbpol,]

    ## rasterization of wb1
    tutu <- mcp.rast(xycoord, toto)
    image(tutu)

    polygon(xycoord, lwd = 2)

[Package adehabitat version 1.4 Index]