count.points.id {adehabitat} | R Documentation

## Number of Points in Each Pixel of a Raster Map

### Description

`count.points` counts the number of points in each pixel of a raster map of class `kasc` or `asc`.
`count.points.id` counts the number of points falling in each pixel of a raster map of class `kasc` or `asc`, for different sets of points (e.g. the relocations of several animals monitored using radio-tracking)

### Usage

    count.points(xy, w)
    count.points.id(xy, id, w)

### Arguments

`xy` | a data frame containing the x and y coordinates of the points.
`id` | a factor giving, for each point, the membership of a point to a set.
`w` | an object of class `asc`, `kasc` or `mapattr`.

### Value

`count.points` returns an object of class `asc` containing the number of points in each cell of the raster map.
`count.points.id` returns an object of class `kasc`, with one column per level of the factor `id`, containing the number of points numbered in each cell of the raster map.

### Author(s)

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

### See Also

`as.kasc` for additionnal information on objects of class `kasc`, and `storemapattr` for further information on objects of class `mapattr`.

### Examples

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

    ## Counts the number of relocations of each wild boar
    ## per pixel of the raster map
    (nlocrast <- count.points.id(locs[,4:5], locs[,1], kasc))
    image(nlocrast)

    ## Counts the number of all relocations
    ## per pixel of the raster map
    (nlocrast <- count.points(locs[,c("X","Y")], kasc))
    image(nlocrast)

[Package adehabitat version 1.4 Index]