strategicplayers-package: Strategic Players

Description Details Author(s) References Examples

Description

Identifies individuals in a social network who should be the intervention subjects for a network intervention in which you have a group of targets, a group of avoiders, and a group that is neither.

Details

The DESCRIPTION file: This package was not yet installed at build time.

Index: This package was not yet installed at build time.
~~ An overview of how to use the package, including the most important functions ~~

Author(s)

Miles Ott

Maintainer: Miles Ott <miles_ott@alumni.brown.edu>

References

~~ Literature or other references for background information ~~

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
require(sna)

network<-rgraph(20, tprob=.2)         #generate a bernoulli random network on 20 nodes
geo<-geodist(network)[2]$gdist        #get the geodesic distances of the network
targets<-1:10                         #defining the target group
avoids<-11:14                         #defining the avoidance group
theta<-.8                             #defining the theta parameter

spset<-sp(4, geo, targets, avoids, theta, n.loops=100)  #find sp set of size 4
spset

distance(geo, targets, avoids, theta, spset)          #calculates distance metric for spset

#plot the network with the strategic player set highlighted in yellow
colors<-rep("white", 20)
colors[targets]<-"green"
colors[avoids]<-"red"
colors[spset]<-"yellow"
par(mar=c(1,1,1,1))
gplot(network, vertex.col=colors, usearrows=FALSE, 
      edge.col="grey", vertex.border="grey", vertex.cex=1.7, pad=0, label=1:dim(network)[1])

strategicplayers documentation built on May 29, 2017, 3:34 p.m.

Search within the strategicplayers package
Search all R packages, documentation and source code