YF_Brazil {epiflows}R Documentation

Yellow Fever Data from Brazil; 2016-12 to 2017-05

Description

This data set contains flows to and from five states in Brazil formatted in a list with the following items:

Usage

data("Brazil_epiflows")
  data("YF_coordinates")
  data("YF_locations")
  data("YF_flows")
  data("YF_Brazil")

Format

An object of class list of length 4.

Details

References

Dorigatti I, Hamlet A, Aguas R, Cattarino L, Cori A, Donnelly CA, Garske T, Imai N, Ferguson NM. International risk of yellow fever spread from the ongoing outbreak in Brazil, December 2016 to May 2017. Euro Surveill. 2017;22(28):pii=30572. DOI: doi:10.2807/1560-7917.ES.2017.22.28.30572

See Also

make_epiflows() for transformation to an epiflows object estimate_risk_spread()

Examples

# This is an example of an epiflows object
data("Brazil_epiflows")
Brazil_epiflows

# The above data was constructed from a data frame containing flows and 
# one containing location metadata
data("YF_flows")
data("YF_locations")
ef <- make_epiflows(flows         = YF_flows, 
                    locations     = YF_locations, 
                    pop_size      = "location_population",
                    duration_stay = "length_of_stay",
                    num_cases     = "num_cases_time_window",
                    first_date    = "first_date_cases",
                    last_date     = "last_date_cases"
                   )

# Both of the above data frames were constructed like so:

data("YF_Brazil")

# Create the flows data frame
from  <- as.data.frame.table(YF_Brazil$T_D, stringsAsFactors = FALSE)
to    <- as.data.frame.table(t(YF_Brazil$T_O), stringsAsFactors = FALSE)
flows <- rbind(from, to)
colnames(flows) <- c("from", "to", "n")

## Create the locations data frame
los <- data.frame(location_code    = names(YF_Brazil$length_of_stay), 
                  length_of_stay   = YF_Brazil$length_of_stay,
                  stringsAsFactors = FALSE
                 )
locations <- merge(x   = YF_Brazil$states, 
                   y   = los, 
                   by  = "location_code", 
                   all = TRUE)

## Use both to create the epiflows object.
ef <- make_epiflows(flows, 
                    locations, 
                    pop_size = "location_population",
                    duration_stay = "length_of_stay",
                    num_cases = "num_cases_time_window",
                    first_date = "first_date_cases",
                    last_date = "last_date_cases"
)

[Package epiflows version 0.2.1 Index]