Description Usage Arguments Details Value Author(s) See Also Examples
Converts a CSS in cssTools
package format to a CSS in sna
package format.
1 | cssTools2sna(d)
|
d |
A CSS in |
In cssTools
package, a CSS d
is coded in a three dimensional array
such that d[,,i]
is the i-th slice. In sna
package, the same object
is coded in a three dimensional array such that d[i,,]
is the i-th slice.
The cssTools2sna
function transforms cssTools
format to sna
format.
The same CSS coded in sna
format.
Deniz Yenigun, Gunes Ertan, Michael Siciliano
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # Consider the example in Siciliano et. al. (2012),
# a network with five actors A, B, C, D, E
sA=matrix(c(0,0,1,0,1,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0),5,5)
sB=matrix(c(0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0),5,5)
sC=matrix(c(0,1,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0),5,5)
sD=matrix(c(0,0,1,0,1,0,0,1,1,0,1,1,0,0,0,0,1,0,0,1,1,0,0,1,0),5,5)
sE=matrix(c(0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,1,0,1,0),5,5)
d=array(dim=c(5,5,5))
d[,,1]=sA
d[,,2]=sB
d[,,3]=sC
d[,,4]=sD
d[,,5]=sE
# Here d is coded in cssTools package format
# Switching between sna and cssTools formats
e=cssTools2sna(d)
f=sna2cssTools(e)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.