Igraph

Материал из Letopisi.Ru — «Время вернуться домой»
Перейти к: навигация, поиск

Пакет, предназначенный для работы с данными и представлениями сетевых отношений. Подробная документация:


Содержание

Объединение узлов

The function contract.vertices() merges several vertices into one. By computing the community structure, one can control how this merging happens. At conclusion of the contraction, two vertices can have multiple edges.

Contracting and simplifying a network graph
http://blog.revolutionanalytics.com/2015/08/contracting-and-simplifying-a-network-graph.html

Объединение связей

The equivalent step for edges is simplify(). A simplified graph contains only a single edge between two nodes. The simplification step can compute summary statistics for the combined edges, for example the sum of edge weights.

edge.attr.comb
http://www.inside-r.org/packages/cran/igraph/docs/attribute.combination

Варианты:

  • g4 <- simplify(g3, edge.attr.comb = list(weight = "sum"))
  • g4 <- simplify( g3, remove.multiple = T, remove.loops = T, edge.attr.comb=c(weight="sum", type="ignore") )

Атрибуты узлов

  • vertex.color цвет вершины
    • vertex.color="gold", vertex.color="dark red"
  • vertex.frame.color цвет контура вершины
  • vertex.shape форма обозначения вершины, одно из значений «none», «circle», «square», «csquare», «rectangle», «crectangle», «vrectangle», «pie», «raster», «sphere»
  • vertex.size размер вершины (по умолчанию 15)
  • vertex.size2 второй параметр размера вершины (например, для прямоугольника)
  • vertex.label вектор символов для обозначения вершин
    • vertex.label.color="black"
  • vertex.label.family семейство шрифтов для меток вершин (например, «Times», «Helvetica»)
  • vertex.label.font шрифт: 1 — обычный, 2 — жирный, 3 — курсив, 4 — жирный курсив, 5 — символьный
  • vertex.label.cex размер шрифта (множитель, зависит от устройства)
    • vertex.label.cex=0.8
  • vertex.label.dist расстояние между меткой и вершиной

Атрибуты связей

  • edge.arrow.size=.4 - размер стрелки


Разные способы определения сообществ

gcon <- simplify(gcon, edge.attr.comb = list(weight = "sum", function(x)length(x)))

What are the differences between community detection algorithms in igraph?
http://stackoverflow.com/questions/9471906/what-are-the-differences-between-community-detection-algorithms-in-igraph/9478989#9478989


Finding clusters of CRAN packages using igraph
http://blog.revolutionanalytics.com/2014/12/finding-clusters-of-cran-packages-using-igraph.html



Персональные инструменты
Инструменты