Learn R Programming

adehabitat (version 1.1-1)

buffer: Compute Buffers

Description

buffer compute buffers around a set of locations. buffer.ani is to be used when the points can be grouped into several categories (e.g. the relocations of several animals monitored using radio-tracking; the function buffer is then applied to each animal).

Usage

buffer(pts, x, dist)
buffer.ani(pts, fac, x, dist)

Arguments

pts
a data frame with two columns (x and y coordinates of the points)
x
either an object of class asc or kasc with the same attributes as those desired for the output, or an object of class mapattr (see storemapattr)
dist
a value of distance
fac
a factor defining the categories of the points

Value

  • buffer returns an object of class asc, with 1 for pixels located within a specified distance of given points, and NA otherwise. buffer.ani returns a data frame of class kasc, with each column corresponding to one level of the factor fac.

See Also

as.kasc for additionnal information on objects of class kasc, import.asc for further information on objects of class asc, storemapattr for further information on objects of class mapattr.

Examples

Run this code
data(puechabon)

# locs is the data frame containing the
# relocations of wild boars monitored by radio-tracking 
locs <- puechabon$locs

# sa is the "kasc" object of maps of the study area
sa <- puechabon$kasc

# Buffer of 500 m around all relocations
bu <- buffer(locs[,4:5], sa, 500)
image(bu)

# displays all the pixels of the study area within 500 m
# of a relocation of each monitored wild boar
buani <- buffer.ani(locs[,4:5], locs[,1], sa, 500)
image(buani)

Run the code above in your browser using DataLab