Learn R Programming

archeofrag (version 1.2.0)

frag.layers.cohesion: Cohesion measure of layers

Description

Returns the cohesion value of two archaeological spatial units (layers or any other type of spatial units).

Usage

frag.layers.cohesion(graph, layer.attr, morphometry, x, y, z, verbose=TRUE)

Value

If the graph has only two spatial units, the function returns a numeric vector with a cohesion value (]0;1[) for each spatial units (sorted in alphanumerical order). If the graph has more than two spatial units, the function returns a matrix with cohesion values for each pair of spatial units.

Arguments

graph

An undirected igraph object.

layer.attr

Character. The name of the vertices attribute giving the spatial unit of the fragments.

morphometry

Character. Optional, to pass to the `frag.edges.weighting` function: name of the vertex attribute with the morphometric value of the fragments.

x

Character. Optional, to pass to the `frag.edges.weighting` function: name of the vertex attribute with the "x" coordinate of the fragments.

y

Character. Optional, to pass to the `frag.edges.weighting` function: name of the vertex attribute with the "y" coordinate of the fragments.

z

Character. Optional, to pass to the `frag.edges.weighting` function: name of the vertex attribute with the "z" coordinate of the fragments.

verbose

Logical. Whether to print or not warning messages.

Author

Sebastien Plutniak <sebastien.plutniak at posteo.net>

Details

Note that this function must be used after weighting the edges with frag.edges.weighting.

The cohesion value of a spatial unit is computed as:

$$\frac{V_{unit_i} + W_{unit_i}}{ \sum_{j=1}^{2} V_{unit_j} + W_{unit_j}} $$

with V the number of vertices in the unit and W the sum of the edge weights within the unit.

The measure takes into account the balance between the information about each spatial unit. Results range in ]0;1[, with 0 for two spatial units with only inter-spatial units connection relationships, and 1 if there are not inter-spatial units relationships and a significant imbalance of information on the two spatial units.

The basic use of this function is intended for a graph with two spatial units, whose edges have been previously weighted using the frag.edges.weighting function (an error message is displayed if the vertice attribute "layer" contains less than two spatial units, and if the graph does not have an edge attribute "weight").

However, this function can also be used for a graph with more than two spatial units. In this case, a subgraph is generated for each pair of spatial units (using the frag.get.layers.pair function), the frag.edges.weighting function is applied to weight their edges (a warning message is displayed), and the cohesion is computed.

See Also

frag.edges.weighting, frag.get.layers.pair

Examples

Run this code
g <- frag.simul.process(n.components=20, vertices=50, disturbance=.1)
frag.layers.cohesion(g, layer.attr="layer")

Run the code above in your browser using DataLab