igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Fwd: scale-free/preferential attachment matrix


From: Sebastián Goinheix
Subject: Re: [igraph] Fwd: scale-free/preferential attachment matrix
Date: Wed, 21 Dec 2016 23:24:52 -0300

Thanks George


--------
Sebastián Goinheix
Instituto de Economía - UdelaR
Tel: 24001369 (int. 116)
Por favor, evite imprimir este correo.

2016-12-21 16:33 GMT-03:00 George Vega Yon <address@hidden>:
Does this works?

rm(list=ls())

x   <- c("A", "A", "B", "B", "B")
mat <- outer(x, x, "==")
mat[] <- as.integer(mat)

dimnames(mat) <- list(x,x)
mat

> mat
  A A B B B
A 1 1 0 0 0
A 1 1 0 0 0
B 0 0 1 1 1
B 0 0 1 1 1
B 0 0 1 1 1

Best,


On Wed, Dec 21, 2016 at 9:21 AM, Sebastián Goinheix <address@hidden> wrote:
Hi,
​​
​​
I want to perform network regresion with QAP procedure (netlm function of sna package).

I ​have matrices with some inter-organizational relations, and with ​calculated matrices for homophily hypotheses through the bipartite.projection function. 
But now I need a matrix that contains links from all nodes to those that have a specific attribute, say "A". For example:
nodes attributes
1 A
2 A
3 B
4 B
5 B
Therefore, the resulting adjacency matrix will be:
  1 2 3 4 5
1 0 1 1 1 1
2 1 0 1 1 1
3 1 1 0 0 0
4 1 1 0 0 0
5 1 1 0 0 0 
​​
​​
I assume the sample_pa function will not work since the network is based on vertex attributes
 and​
 the model should not be random
​.​

How can I get it in Igraph (or other)?
Thanks


--------
Sebastián Goinheix
Instituto de Economía - UdelaR
Tel: 24001369 (int. 116)
Por favor, evite imprimir este correo.


_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help



_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help



reply via email to

[Prev in Thread] Current Thread [Next in Thread]