lowres {adehabitatMA} | R Documentation |
Reducing the Resolution of a Map
Description
lowres
is used to reduce the resolution of
maps of class SpatialPixelsDataFrame
.
Usage
lowres(x, np = 2, which.fac=NULL, ...)
Arguments
x |
an object of class |
np |
a number giving the number of pixels to merge together (see below) |
which.fac |
a vector containing the indices of the columns of
|
... |
further arguments passed to or from other methods |
Details
The function merges together squares of np * np
pixels. For
variables of type "numeric"
, the function averages the value of
the variable. For maps of type "factor"
, the function gives
the most frequent level in the square of np * np
pixels. When
several levels are equally represented in the square of np * np
pixels, the function randomly samples one of these levels.
Value
Returns an object of class SpatialPixelsDataFrame
.
Author(s)
Clement Calenge clement.calenge@ofb.gouv.fr
See Also
SpatialPixelsDataFrame-class
for further
information on objects of class SpatialPixelsDataFrame
.
Examples
data(meuse.grid)
m <- SpatialPixelsDataFrame(points = meuse.grid[c("x", "y")],
data = meuse.grid)
m
m <- m[,3:6]
## The initial image
image(m,3)
## The transformed image
m2 <- lowres(m, np = 4)
image(m2, 3)