Description Usage Arguments Value Note
View source: R/classNeighborFunction.R
This function calculates statistics for every object of a specific class to its neighbor objects.
It is computationally identical to the relationalObjectFunction
.
However, the function additionally enables the possibility to perform statistics for neighbors in a specific direction,
likewise the relationalClassFunction
, and to select class objects by expressions.
1 2 3 4 5 6  classNeighborFunction(spdf, nb, class.var, var, calc.nb.flow = FALSE,
col.flow = NULL, bb.intersection = "rgeos",
class.as.neighbors = FALSE, bb = NULL, return.bb.flow = FALSE,
scale.factor.flow = c(1, 1), centroid.flow = TRUE,
set.centroid.flow = "inverse", k.centroid.flow = 2, k.flow = 2,
scale.side.flow = "small", quiet = TRUE)

spdf 
SpatialPolygonsDataFrame, or full path of a shapefile 
nb 
object neighborhood based on 
class.var 
defination of class. Can be string or integer, or an expression in form of a list. For examples: class = as.integer(1), class = list("> 2.5", "expression"), class = list(c("> 2", "&", "< 7"), "expression") 
var 
vector with number or name defining 1. field of evaluation (i.e. slope) and 2. field of weights (i.e. area). For example: c("Slope", "Area") or c(1,2) 
calc.nb.flow 
include statistics for neighbors in flow direction. Default: FALSE 
col.flow 
column specifying direction. Default: NULL 
bb.intersection 
method for intersection with bounding box. Default: "rgeos" (alternative: "sp") 
class.as.neighbors 
class object is also neighbor object. Default: FALSE 
bb 
input of bounding box geometry. Default: NULL 
return.bb.flow 
return geoemtry of counding box. Default: FALSE 
quiet 
no outputs in console. Default: TRUE 
only.neighbors 
object statistics are computed only for neighbors. Default: TRUE (FALSE means computation for the entiry data) 
other... 
see 
data.frame containing object statistics, and optional the created geometry of getBoundingBox
class statistics to neighbor objects acccording to ECOGNITION DEVELOPER (2014: 253255, 375381):
see relationalObjectFunction
~_nb_FlAl  statistics for all objects located in flow direction
~_nb_FlMa  statistics for direct neighbors located in flow direction
ECOGNITION DEVELOPER (2014) Reference Book. Trimble Documentation, München, Germany
see getBoundingBox
SpatialPolygonsDataFrame objects with NA values are ignored
SpatialPolygonsDataFrame objects without neighbors are ignored
SpatialPolygonsDataFrame input must have a valid Class and ID field. ID field must be contained of unique numbers
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.