distfacmap | R Documentation |
This function computes maps of distances to patches belonging to the
different levels of a factor variable (mapped in an object of class
SpatialPixelsDataFrame
).
distfacmap(x, lev = NULL)
x |
an object of class |
lev |
a vector of character strings giving the labels of the levels of the factor. |
An object of class SpatialPixelsDataFrame
.
Clement Calenge clement.calenge@ofb.gouv.fr
SpatialPixelsDataFrame-class
for additionnal
information on objects of class SpatialPixelsDataFrame
.
## Load meuse.grid data set and converts it to
## SpatialPixelsDataFrame
data(meuse.grid)
m <- SpatialPixelsDataFrame(points = meuse.grid[c("x", "y")],
data = meuse.grid)
## look at the soil type
image(m[,6])
## compute the distance to each soil type
sor <- distfacmap(m[,6], lev = c("type1","type2", "type3"))
## The results
sor
mimage(sor)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.