Description Usage Arguments Details Value Examples
attr2mat
converts a vector indicating attribute to a matrix
1 |
attr |
vector of input attribute (numeric or logical vector). |
method |
|
diag.val |
the diag value to be filled. If |
This function convertes a vector of matrices attr to a new matrix
mat[i,j] based on the definition set by method
:
"match"
(matching the value): Matrix[i,j] = 1 if attr[i] = attr[j]; 0 otherwise.
"match.one"
(maching the value 1): Matrix[i,j] = 1 if attr[i] = attr[j] = 1; 0 otherwise.
"diff"
(difference): Matrix[i,j] = attr[i] - [j].
"abs.diff"
(absolute difference): Matrix[i,j] = |attr[i] - attr[j]|.
"sqd.diff"
(squared difference): Matrix[i,j] = (attr[i] - attr[j]=1)^2.
"sum"
(sum): Matrix[i,j] = attr[i] + attr[j] = 1.
"product"
(product): Matrix[i,j] = attr[i] * attr[j].
"identity"
(identity coefficient): Matrix[i,j] = 2 * (attr[i] * attr[j])/(attr[i]^2 + attr[j]^2.
"row"
(duplicating row actors' attributes: sender effect): Matrix[i,j] = attr[i].
"column"
(duplicating column actors' attributes: receiver effect): Matrix[i,j] = attr[j].
"max"
(maximam value): Matrix[i,j] = max(attr[i], attr[j]).
"min"
(minimum value): Matrix[i,j] = min(attr[i], attr[j]).
"mean"
(mean value): Matrix[i,j] = mean(attr[i], attr[j]).
a matrix converted from a vector.
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.