plot.epicontacts: Plot epicontacts objects

Description Usage Arguments Details Author(s) See Also Examples

View source: R/plot.R

Description

This function plots epicontacts objects using various approaches. The default method uses vis_epicontacts.

Usage

1
2
3
## S3 method for class 'epicontacts'
plot(x, node_color = "id", method = c("visNetwork",
  "graph3D"), thin = TRUE, ...)

Arguments

x

An epicontacts object

node_color

An integer or a character string indicating which attribute column in the linelist should be used to color the nodes.

method

A character string indicating the plotting method to be used; available values are "visNetwork" and "graph3D"; see details.

thin

A logical indicating if the data should be thinned so that only cases with contacts should be plotted.

...

Further arguments passed to the plotting methods.

Details

This function is merely a wrapper for other plotting functions in the package, depending on the value of method:

Author(s)

Thibaut Jombart ([email protected])

See Also

vis_epicontacts, which uses the package visNetwork, and codeawesome for icon codes.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
if (require(outbreaks)) {
## example using MERS outbreak in Korea, 2014
head(mers_korea_2015[[1]])
head(mers_korea_2015[[2]])

x <- make_epicontacts(linelist = mers_korea_2015[[1]],
                      contacts = mers_korea_2015[[2]], directed=TRUE)

## Not run: 
plot(x)
plot(x, "place_infect")
plot(x, "loc_hosp", legend_max = 20, annot = TRUE)
plot(x, "place_infect", node_shape = "sex",
     shapes = c(M = "male", F = "female"))
plot(x, 4)
plot(x, 4, method = "graph3D")

## End(Not run)
}

epicontacts documentation built on May 2, 2019, 11:29 a.m.