Learn R Programming

archeofrag (version 1.2.0)

frag.get.layers: Extracts the subgraph of each selected archaeological spatial unit.

Description

Extracts the subgraph of each selected archaeological spatial unit (stratigraphic layer or any other type of spatial unit).

Usage

frag.get.layers(graph, layer.attr, sel.layers)

Value

A list with a graph for each selected stratigraphic layer.

Arguments

graph

An undirected igraph object.

layer.attr

Character. The name of the vertices attribute giving the spatial unit of each fragment.

sel.layers

Character. The identifier(s) of the stratigraphic spatial units to retrieve.

Author

Sebastien Plutniak <sebastien.plutniak at posteo.net>

Details

This function is only a convenient function to extract the subgraphs of selected archaeological spatial unit (stratigraphic layer or any other type of spatial unit). A graph is created for each layer in the vertex attribute given by the layer.attr argument.

Examples

Run this code
g <- frag.simul.process(n.components=20, vertices=50, disturbance = .15)
igraph::V(g)$layers <- c(rep("layer1", 20), rep("layer2", 20), rep("layer3", 10))
frag.get.layers(g, layer.attr="layers", sel.layers=c("layer1", "layer2"))

Run the code above in your browser using DataLab