make_epiflows: Make an 'epiflows' object

Description Usage Arguments Value Author(s) Examples

View source: R/make_epiflows.R

Description

Takes a list of location data and a matrix of flows, and creates an object of class 'epiflows'. An error is thrown if the input is invalid.

Usage

1
make_epiflows(linelist, flows)

Arguments

linelist

A data frame of location data. Locations should be uniquely identified by codes from the 'code' column.

flows

A numeric matrix of flows between locations. Row and column names must denote location codes.

Value

An epiflows object.

Author(s)

Pawel Piatkowski

Examples

1
2
3
4
input_data <- Mex_travel_2009
flows <- make_epiflows(input_data[[2]], input_data[[1]])
print(subset(flows$linelist, code == "MEX")) # print the data for Mexico
print(flows$flows["MEX", ]) # ...and flows from Mexico to other countries

reconhub/epimaps documentation built on May 7, 2019, 1:30 p.m.