Learn R Programming

adehabitat (version 1.8.20)

lowres: Reducing the Resolution of a Map

Description

lowres is a generic function, having methods for the classes asc and kasc. It is used to reduce the resolution of the maps.

Usage

lowres(x, np = 2, ...)

Arguments

x

an object of class asc or kasc

np

a number giving the number of pixels to merge together (see below)

further arguments passed to or from other methods

Value

Returns an object of class asc or kasc.

Details

The function merges together squares of np * np pixels. For maps of type "numeric" (see help(asc)), 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.

See Also

asc and kasc for further information on objects of class asc and kasc respectively.

Examples

Run this code
# NOT RUN {
data(puechabon)
kasc <- puechabon$kasc

## The initial image
image(kasc)

## The transformed image
m <- lowres(kasc, np = 4)
image(m)

# }

Run the code above in your browser using DataLab