net.attack: Network attack

Description Usage Arguments Value Examples

View source: R/net.attack.R

Description

Retrieve the network after vertex attack.

Usage

1
2
net.attack(graph, mode = c("exact", "sample"), sample.number = 10,
  nodes = NULL, vertex.name = NULL, ...)

Arguments

graph

An igraph object.

mode

Attack mode, possible values are exact and sample.

sample.number

Number of attacked vertex, if mode is sample.

nodes

Index of attacked vertex, if mode is exact.

vertex.name

Name of attacked vertex, if mode is exact.

...

Other arguments.

Value

An igraph object.

Examples

1
2
3
g<-barabasi.game(100,power=0.8,directed=FALSE)
g1<-net.attack(g,mode="sample",sample.number=10)
g1<-net.attack(g,mode="exact",nodes=sample(1:100,20))

Example output

Loading required package: Rcpp
Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

Loading required package: MCL
Loading required package: linkcomm
Loading required package: RColorBrewer

Welcome to linkcomm version 1.0-11

For a step-by-step guide to using linkcomm functions:
   > vignette(topic = "linkcomm", package = "linkcomm")
To run an interactive demo:
   > demo(topic = "linkcomm", package = "linkcomm")
To cite, see:
   > citation("linkcomm")
NOTE: To use linkcomm, you require read and write permissions in the current directory (see: help("getwd"), help("setwd"))

ProNet documentation built on May 30, 2017, 2:02 a.m.