Hi,

create a factor and supply it in the 'types' argument. E.g.

g <- graph.ring(10)
types <- rep(c("odd", "even"), length.out=vcount(g))
assortativity.nominal(g, factor(types))
# [1] -1

Just make sure that the order of the factor corresponds to the order of
your vertices.

Gabor



On Mon, May 13, 2013 at 4:17 AM, Renuka Hodigere <[email protected]> wrote:

> Hello,
>
> I would like to get the degree of assortativity in a network based on
> certain categorical attributes of the nodes e.g. nodes in the network have
> various attributes like sex, profession, education etc. I would like to
> know to what extent the network is assortative based on these attributes.
>
> I tied using the assortativity.nominal function in igraph but I am not
> sure where I should specify the nominal variable in the script.
>
> Thanks in advance for the help.
>
> Regards,
>
> renuka
>
> _______________________________________________
> igraph-help mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>
>


-- 
Gabor Csardi <[email protected]>     MTA KFKI RMKI
_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to