homo_hetr_mat: Differentiate homophilous and heterophilious graph.

Description Usage Arguments Value Examples

View source: R/homo_hetr_mat.R

Description

homo_hetr_mat takes a matrix and returns a list of matrices in which homophilous and heterophilious ties are differentiated.

Usage

1
homo_hetr_mat(mat, attr, alpha = 0.5)

Arguments

mat

a matrix of a graph.

attr

a vector of attributes.

alpha

a cut-off value to differentiate homophilous and heterophilious ties. If the difference of attr values between i and j exceeds the value of alpha, then the relationship between i and j is treated as heterophilious relationship. Otherwise homophilous.

Value

a list of matrices: a homopilious matrix and a heterophilious matrix.

Examples

1
2
3
4
5
6
library(sna)
mat <- sna::rgraph(5)
dimnames(mat) <- list(LETTERS[1:5], LETTERS[1:5])
attr <- c(0,0,0,1,1)

homo_hetr_mat(mat, attr)

huhn1234/vogeltools documentation built on Jan. 17, 2020, 5:21 p.m.