Learn R Programming

EpiILMCT (version 1.1.8)

plot.contactnet: Plot the contact network of contactnet object

Description

plot.contactnet is an S3 method that plots the contact network of an S3 object of class contactnet.

Usage

# S3 method for contactnet
plot(x, ...)

Value

Plot of the contact network.

Arguments

x

an S3 object of class contactnet (i.e. the output of the contactnet function).

...

additional arguments that are passed to the generic plot function.

See Also

contactnet.

Examples

Run this code
set.seed(12345)
loc<- matrix(cbind(runif(50, 0, 10),runif(50, 0, 10)), ncol = 2, nrow = 50)
net1<- contactnet(type = "powerlaw", location = loc, beta = 1.5, nu = 0.5)
plot(net1)
net2<- contactnet(type = "Cauchy", location = loc, beta = 0.5)
plot(net2)
net3<- contactnet(type = "random", num.id = 50, beta = 0.08)
plot(net3)
# adding some options to the igraph plot:
plot(net3, vertex.color = "red", vertex.size = 8, edge.color = "black",
vertex.label.cex = 0.7, vertex.label.color = "black") 

Run the code above in your browser using DataLab