| sna2cssTools {cssTools} | R Documentation |
Convert a CSS in sna Format to a CSS in cssTools Format
Description
Converts a CSS in sna package format to a CSS in cssTools package format.
Usage
sna2cssTools(d)
Arguments
d |
A CSS in |
Details
In sna package, a CSS d is coded in a three dimensional array such that
d[i,,] is the i-th slice. In cssTools package, the same object is coded in a
three dimensional array such that d[,,i] is the i-th slice. The sna2cssTools
function transforms sna format to cssTools format.
Value
The same CSS coded in cssTools format.
Author(s)
Deniz Yenigun, Gunes Ertan, Michael Siciliano
See Also
Examples
# 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)
[Package cssTools version 1.0 Index]