| ascgen {adehabitat} | R Documentation |
ascgen creates an object of class asc using
a set of points.
ascgen(xy = NULL, cellsize = NULL, nrcol = 10, count = TRUE)
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 |
Returns an object of class asc.
Clement Calenge clement.calenge@oncfs.gouv.fr
asc for additional information on objects
of class asc.
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)