From cdf4b3dbddfdbdb2b29bd744b5d080080be8e019 Mon Sep 17 00:00:00 2001
From: "aviator-app[bot]" Creating a graphWe can print the graph to get a summary of its nodes and edges:
g
## IGRAPH e93030c UN-- 10 2 --
+## IGRAPH 4286305 UN-- 10 2 --
## + attr: name (v/c)
-## + edges from e93030c (vertex names):
+## + edges from 4286305 (vertex names):
## [1] 1--2 1--5
This means: Undirected Named graph
with 10 vertices and 2 edges, with the
@@ -169,7 +169,7 @@
Creating a graph
summary(g)
-## IGRAPH e93030c UN-- 10 2 --
+## IGRAPH 4286305 UN-- 10 2 --
## + attr: name (v/c)
The same function make_graph
can create some notable
graphs by just specifying their name. For example you can create the
@@ -247,9 +247,9 @@
Adding/deleting vertices and edgesg <- g %>% add_edges(edges=c(1,34)) %>% add_vertices(3) %>%
add_edges(edges=c(38,39, 39,40, 40,38, 40,37))
g
-## IGRAPH 80ebbff U--- 40 86 -- Zachary
+## IGRAPH 1c4d090 U--- 40 86 -- Zachary
## + attr: name (g/c)
-## + edges from 80ebbff:
+## + edges from 1c4d090:
## [1] 1-- 2 1-- 3 1-- 4 1-- 5 1-- 6 1-- 7 1-- 8 1-- 9 1--11 1--12
## [11] 1--13 1--14 1--18 1--20 1--22 1--32 2-- 3 2-- 4 2-- 8 2--14
## [21] 2--18 2--20 2--22 2--31 3-- 4 3-- 8 3--28 3--29 3--33 3--10
@@ -332,7 +332,7 @@ Constructing graphs
graph1 <- make_tree(127, 2, mode = "undirected")
summary(g)
-## IGRAPH d888d54 U--- 5 3 -- Ring graph
+## IGRAPH a777c5f U--- 5 3 -- Ring graph
## + attr: name (g/c), mutual (g/l), circular (g/l)
This generates a regular tree graph with 127 vertices, each vertex
having two children. No matter how many times you call
@@ -349,7 +349,7 @@
Constructing graphs
graph1 <- sample_grg(100, 0.2)
summary(graph1)
-## IGRAPH 57efbc1 U--- 100 510 -- Geometric random graph
+## IGRAPH c638868 U--- 100 529 -- Geometric random graph
## + attr: name (g/c), radius (g/n), torus (g/l)
This generates a geometric random graph: n points are chosen
randomly and uniformly inside the unit square and pairs of points closer
@@ -400,7 +400,7 @@
Setting and retrieving attributesV(g)$gender <- c("f", "m", "f", "m", "m", "f", "m")
E(g)$is_formal <- c(FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE)
summary(g)
-## IGRAPH 84e6a15 UN-- 7 9 --
+## IGRAPH 778e958 UN-- 7 9 --
## + attr: name (v/c), age (v/n), gender (v/c), is_formal (e/l)
V
and E
are the standard way to obtain a
sequence of all vertices and edges, respectively. This assigns an
@@ -442,7 +442,7 @@
Setting and retrieving attributes
V(g)$name[1:3] <- c("Alejandra", "Bruno", "Carmina")
V(g)
-## + 7/7 vertices, named, from 84e6a15:
+## + 7/7 vertices, named, from 778e958:
## [1] Alejandra Bruno Carmina Frank Dennis Esther George
To delete attributes:
@@ -554,12 +554,12 @@ Selecting vertices
seq <- V(graph)[2, 3, 7]
seq
-## + 3/10 vertices, from 2c53dba:
+## + 3/10 vertices, from 2bd3972:
## [1] 2 3 7
seq <- seq[1, 3] # filtering an existing vertex set
seq
-## + 2/10 vertices, from 2c53dba:
+## + 2/10 vertices, from 2bd3972:
## [1] 2 7
Selecting a vertex that does not exist results in an error:
@@ -655,12 +655,12 @@ Selecting edges
E(g)[.from(3)]
-## + 4/9 edges from 84e6a15 (vertex names):
+## + 4/9 edges from 778e958 (vertex names):
## [1] Alejandra--Carmina Carmina --Frank Carmina --Dennis Carmina --Esther
Of course it also works with vertex names:
E(g)[.from("Carmina")]
-## + 4/9 edges from 84e6a15 (vertex names):
+## + 4/9 edges from 778e958 (vertex names):
## [1] Alejandra--Carmina Carmina --Frank Carmina --Dennis Carmina --Esther
Using .to
filters edge sequences based on the target
vertices. This is different from .from
if the graph is
@@ -675,7 +675,7 @@
Selecting edges
-## + 3/9 edges from 84e6a15 (vertex names):
+## + 3/9 edges from 778e958 (vertex names):
## [1] Carmina--Dennis Carmina--Esther Dennis --Esther
To make the %--%
operator work with names, you can build
string vectors containing the names and then use these vectors as
@@ -694,7 +694,7 @@
Selecting edges## [1] "Alejandra" "Carmina" "Esther"
-## + 5/9 edges from 84e6a15 (vertex names):
+## + 5/9 edges from 778e958 (vertex names):
## [1] Alejandra--Bruno Alejandra--Frank Carmina --Frank Carmina --Dennis
## [5] Dennis --Esther
diff --git a/articles/igraph_ES.html b/articles/igraph_ES.html
index f1df1895f3..2a4476c1fc 100644
--- a/articles/igraph_ES.html
+++ b/articles/igraph_ES.html
@@ -159,9 +159,9 @@ Crear un grafo
g
-## IGRAPH c42335c UN-- 10 2 --
+## IGRAPH 1a4b0bd UN-- 10 2 --
## + attr: name (v/c)
-## + edges from c42335c (vertex names):
+## + edges from 1a4b0bd (vertex names):
## [1] 1--2 1--5
Esto significa: grafo no dirigido (Undirected) con
10 vértices y 2 aristas, que se
@@ -173,7 +173,7 @@
Crear un grafo
summary(g)
-## IGRAPH c42335c UN-- 10 2 --
+## IGRAPH 1a4b0bd UN-- 10 2 --
## + attr: name (v/c)
También make_graph
puede crear algunos grafos destacados
con sólo especificar su nombre. Por ejemplo, puedes generar el grafo que
@@ -257,9 +257,9 @@
Añadir y borrar vértices y arist
g <- g %>% add_edges(edges=c(1,34)) %>% add_vertices(3) %>%
add_edges(edges=c(38,39, 39,40, 40,38, 40,37))
g
-## IGRAPH 824574f U--- 40 86 -- Zachary
+## IGRAPH 12bdb50 U--- 40 86 -- Zachary
## + attr: name (g/c)
-## + edges from 824574f:
+## + edges from 12bdb50:
## [1] 1-- 2 1-- 3 1-- 4 1-- 5 1-- 6 1-- 7 1-- 8 1-- 9 1--11 1--12
## [11] 1--13 1--14 1--18 1--20 1--22 1--32 2-- 3 2-- 4 2-- 8 2--14
## [21] 2--18 2--20 2--22 2--31 3-- 4 3-- 8 3--28 3--29 3--33 3--10
@@ -346,7 +346,7 @@ Construcción de grafos
graph1 <- make_tree(127, 2, mode = "undirected")
summary(g)
-## IGRAPH f23b024 U--- 5 3 -- Ring graph
+## IGRAPH 11f39c6 U--- 5 3 -- Ring graph
## + attr: name (g/c), mutual (g/l), circular (g/l)
Esto genera un grafo regular en forma de árbol con 127 vértices, cada
vértice con dos hijos. No importa cuántas veces llames a
@@ -363,7 +363,7 @@
Construcción de grafos
graph1 <- sample_grg(100, 0.2)
summary(graph1)
-## IGRAPH 48d4cd4 U--- 100 524 -- Geometric random graph
+## IGRAPH 0faf5ad U--- 100 485 -- Geometric random graph
## + attr: name (g/c), radius (g/n), torus (g/l)
Esto genera un grafo geométrico aleatorio: Se eligen n
puntos de forma aleatoria y uniforme dentro del espacio métrico, y los
@@ -416,7 +416,7 @@
Establecer y recuperar atributosV(g)$gender <- c("f", "m", "f", "m", "m", "f", "m")
E(g)$is_formal <- c(FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE)
summary(g)
-## IGRAPH 7825726 UN-- 7 9 --
+## IGRAPH 8eff476 UN-- 7 9 --
## + attr: name (v/c), age (v/n), gender (v/c), is_formal (e/l)
V
y E
son la forma estándar de obtener una
secuencia de todos los vértices y aristas respectivamente. Esto asigna
@@ -460,7 +460,7 @@
Establecer y recuperar atributos
V(g)$name[1:3] <- c("Alejandra", "Bruno", "Carmina")
V(g)
-## + 7/7 vertices, named, from 7825726:
+## + 7/7 vertices, named, from 8eff476:
## [1] Alejandra Bruno Carmina Frank Dennis Esther George
Para eliminar atributos:
@@ -575,12 +575,12 @@ Selección de vértices
seq <- V(graph)[2, 3, 7]
seq
-## + 3/10 vertices, from 203af54:
+## + 3/10 vertices, from dae2535:
## [1] 2 3 7
seq <- seq[1, 3] # filtrar un conjunto de vértices existente
seq
-## + 2/10 vertices, from 203af54:
+## + 2/10 vertices, from dae2535:
## [1] 2 7
Al seleccionar un vértice que no existe se produce un error:
@@ -674,12 +674,12 @@ Selección de aristas
E(g)[.from(3)]
-## + 4/9 edges from 7825726 (vertex names):
+## + 4/9 edges from 8eff476 (vertex names):
## [1] Alejandra--Carmina Carmina --Frank Carmina --Dennis Carmina --Esther
Por supuesto, también funciona con nombres de vértices:
E(g)[.from("Carmina")]
-## + 4/9 edges from 7825726 (vertex names):
+## + 4/9 edges from 8eff476 (vertex names):
## [1] Alejandra--Carmina Carmina --Frank Carmina --Dennis Carmina --Esther
Al usar .to
, se filtran la serie de aristas en función
de los vértices de destino o diana. Esto es diferente de
@@ -696,7 +696,7 @@
Selección de aristas
-## + 3/9 edges from 7825726 (vertex names):
+## + 3/9 edges from 8eff476 (vertex names):
## [1] Carmina--Dennis Carmina--Esther Dennis --Esther
Para que el operador %--%
funcione con nombres, puedes
construir vectores de caracteres que contengan los nombres y luego
@@ -716,7 +716,7 @@
Selección de aristas## [1] "Alejandra" "Carmina" "Esther"
-## + 5/9 edges from 7825726 (vertex names):
+## + 5/9 edges from 8eff476 (vertex names):
## [1] Alejandra--Bruno Alejandra--Frank Carmina --Frank Carmina --Dennis
## [5] Dennis --Esther
diff --git a/articles/igraph_ES_files/figure-html/unnamed-chunk-17-1.png b/articles/igraph_ES_files/figure-html/unnamed-chunk-17-1.png
index 6d482d12884115c5381288559f892d6915c29fb2..2ea77e33e60d12e898dfbd99426f3f29cb362384 100644
GIT binary patch
literal 37703
zcmeFZXH=6}v_Bj`MWyLjP!MqR0hBHXh*Sp=B29|)suZa~s+5o@ql_RTPZXr1g7hL)
zI?4csF1-ejAiaf7Ao-t!dGETP-_Li}VwhQ;{hZzR{_TBcUf$DDXFJYy9DzWvAvJF6
zBM^tMw4b9#5C}wQhKw2bb>xAj`fczV{I#Q6i2=Wkd1#n=ArL&Fv>%4Zsa1Of;vxch
z`IH6D+&g{psC?lg9~Hgx>cr`1mH)gB
zdmYAd~Wdl=BEaGZN<*8$~g7ViA&pJ~Xq
zMe^!O`mDO#g)vaM0NxGRe0+{}&gP730`WaGE#QAM;-aIEbtJT73p3$z`pc$N$F4CQ
zMIf*xZD)}>I;1=(mm1`?@ZK&z5f+uvzQd+@hYeLFb0MMi$<0_LVgH59#xe3|$XNUC
z=e8i7+9Eh1j#vw~E><=@B?uxwS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