inst/doc/epicontacts_class.R

## ----init, include=F----------------------------------------------------------
library(knitr)
opts_chunk$set(message=FALSE, warning=FALSE, eval=TRUE, echo=TRUE)

## -----------------------------------------------------------------------------
library(outbreaks)
library(epicontacts)

str(ebola_sim)


## -----------------------------------------------------------------------------
x <- make_epicontacts(linelist = ebola_sim$linelist, contacts = ebola_sim$contacts, directed = TRUE)

## -----------------------------------------------------------------------------
class(x)

## -----------------------------------------------------------------------------
is.list(x)

## -----------------------------------------------------------------------------
head(x$linelist)

## -----------------------------------------------------------------------------
head(x$contacts)

## -----------------------------------------------------------------------------
x

## -----------------------------------------------------------------------------
summary(x)

## -----------------------------------------------------------------------------
rokupafuneral <- subset(x, 
                        node_attribute = list("hospital" = "Rokupa Hospital"), 
                        edge_attribute = list("source" = "funeral"))

## -----------------------------------------------------------------------------
summary(rokupafuneral)

## ---- eval = F----------------------------------------------------------------
#  plot(rokupafuneral, y = "outcome")

Try the epicontacts package in your browser

Any scripts or data that you put into this service are public.

epicontacts documentation built on March 31, 2023, 6:49 p.m.