View source: R/strategicplayers.R

sp | R Documentation |

Takes in the number of intervention subjects you wish to identify, geodesic distances, targets, avoiders, and a parameter that prioritizes avoiding vs targetting, and returns the indecies of the strategic players

```
sp(n.players, gd, targets, avoiders, theta = 0.5, n.loops = 1000)
```

`n.players` |
the number of intervention subjects you wish to identify |

`gd` |
a matrix of geodesic distances for the network of interest |

`targets` |
a vector of indicies of the people you want to spread the intervention to |

`avoiders` |
a vector of indicies of the people you don't want to spread the intervention to |

`theta` |
a number between 0 and 1 which weights the distance metric, 1 only prioritizes closeness to targets, 0 only prioritizes maximizing distance from avoiders. Any number between 0 and 1 will be a compromise of these two goals. |

`n.loops` |
the number of loops to run, the more loops you run the more likely you are to identify the optimal set of strategic players |

returns the indicies for strategic players

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.