adehabitat (version 1.8.20)

ascgen: Creation of Raster Maps

Description

ascgen creates an object of class asc using a set of points.

Usage

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

Arguments

xy

a data frame with two columns containing the x and y coordinates of the points

cellsize

the cellsize attribute of the object of class asc to be created

nrcol

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

count

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

Value

Returns an object of class asc.

See Also

asc for additional information on objects of class asc.

Examples

Run this code
# NOT RUN {
data(puechabon)
lo <- puechabon$locs[,c("X","Y")]
plot(lo, asp = 1, pch = 16)

## lo contains the relocations of wild boars
rast <- ascgen(lo, cellsize = 100)
image(rast)

## Alternatively, one can specify the size of the square raster map
rast <- ascgen(lo, nrcol = 10)
rast
image(rast)

## can be used for further analyses
## (e.g. correspondence analyses)
locs <- puechabon$locs[, c("Name", "X", "Y")]
o <- count.points.id(locs[,2:3], locs[,1], rast)
image(o)
# }

Run the code above in your browser using DataLab