ascgen {adehabitatMA}R Documentation

Making Raster Maps From SpatialPoints Objects

Description

ascgen creates an object of class SpatialPixelsDataFrame using a set of points contained in an object of class SpatialPointsDataFrame.

Usage

ascgen(xy, cellsize = NULL, nrcol = NULL, count = TRUE)

Arguments

xy

an object inheriting the class SpatialPoints

cellsize

the cell size (resolution) of the object of class SpatialPixelsDataFrame to be built

nrcol

the size of the square raster map to be created (number of rows/columns)

count

logical. If TRUE, the resulting object contains the number of points in each cell. If FALSE, all the cells are set to zero

Value

Returns an object of class SpatialPixelsDataFrame.

Author(s)

Clement Calenge clement.calenge@ofb.gouv.fr

See Also

SpatialPixelsDataFrame-class for additional information on objects of class SpatialPixelsDataFrame and SpatialPoints-class for additional information on objects of class SpatialPoints.

Examples


## generates a random sample of points
xy <- matrix(runif(1000), ncol=2)

## coerce them to SpatialPoints
xy <- SpatialPoints(xy)
plot(xy)

## generate a SpatialPixelsDataFrame
## (and count the number of points)
spd <- ascgen(xy, cellsize=0.1)
image(spd)



[Package adehabitatMA version 0.3.16 Index]