This function plots epicontacts objects using the visNetwork package. The produced object is an htmlwidget which will need rendering within a web browser.

vis_epicontacts(x, group = "id", annot = TRUE, legend = TRUE,
  legend_max = 10, col_pal = cases_pal, NA_col = "lightgrey",
  width = "90%", height = "700px", selector = TRUE, editor = FALSE,
  edge_width = 3, ...)

Arguments

x

An epicontacts object.

group

An index or character string indicating which field of the linelist should be used to color the nodes.

annot

An index, logical, or character string indicating which fields of the linelist should be used for annotating the nodes. Logical will be recycled if necessary, so that the default TRUE effectively uses all columns of the linelist.

legend

A logical indicating whether a legend should be added to the plot.

legend_max

The maximum number of groups for a legend to be displayed.

col_pal

A color palette for the groups.

NA_col

The color used for unknown group.

width

The width of the output, in html compatible format (e.g. '90%' or '800px').

height

The height of the output, in html compatible format (e.g. '800px').

selector

A logical indicating if the selector tool should be used; defaults to TRUE.

editor

A logical indicating if the editor tool should be used; defaults to FALSE.

edge_width

An integer indicating the width of the edges. Defaults to 3.

...

Further arguments to be passed to visNetwork.

Value

The same output as visNetwork.

See also

visNetwork in the package visNetwork.

Examples

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, group = "place_infect") # plot(x, group = "loc_hosp", legend_max=20, annot=TRUE) ## --------------------------------------------- }