sna2cssTools: Convert a CSS in 'sna' Format to a CSS in 'cssTools' Format

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/sna2cssTools.R

Description

Converts a CSS in sna package format to a CSS in cssTools package format.

Usage

1

Arguments

d

A CSS in sna package format.

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

cssTools2sna

Examples

 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)

cssTools documentation built on May 30, 2017, 4:32 a.m.