Compute distances to the different levels of a factor map
Compute distances to the different levels of a factor map
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)
Arguments
x: an object of class SpatialPixelsDataFrame with one column (considered as a factor by the function)
lev: a vector of character strings giving the labels of the levels of the factor.
SpatialPixelsDataFrame-class for additionnal information on objects of class SpatialPixelsDataFrame.
Examples
## Load meuse.grid data set and converts it to## SpatialPixelsDataFramedata(meuse.grid)m <- SpatialPixelsDataFrame(points = meuse.grid[c("x","y")], data = meuse.grid)## look at the soil typeimage(m[,6])## compute the distance to each soil typesor <- distfacmap(m[,6], lev = c("type1","type2","type3"))## The resultssor
mimage(sor)