get_stay_data: Make data set of travel and stays

Description Usage Arguments Value Author(s) See Also Examples

View source: R/utils.R

Description

This function builds a data set containing the number of individuals that remain in their home location (stay) or travel to another location during the time span of the survey. The output is designed to provide data for the fit_prob_travel function. The admin unit used to aggregate the travel/stay counts depend on the arguemtns supplied:

  1. When data_pred is supplied and agg_adm = NULL, the lowest admin unit of data_pred is used

  2. When both data_pred and agg_adm are NULL, the lowest admin unit of data is used

Usage

1
get_stay_data(data, data_pred = NULL, agg_adm = NULL)

Arguments

data

generalized data frame described in travel_data_sim or derivative thereof

data_pred

generalized data frame containing the admin units at which to predict probability of travel

agg_adm

optional argument (logical) giving an arbitarary admin unit over which to aggregate travel/stay counts

Value

dataframe with same columns as travel_data_sim data with columns for counts of travel/stay/total

Author(s)

John Giles

See Also

Other data synthesis: get_crossdist(), get_distance_matrix(), get_mob_matrix()

Other travel probability: fit_prob_travel()

Examples

1
stay_data <- get_stay_data(travel_data_sim, agg_adm=2)

COVID-19-Mobility-Data-Network/mobility documentation built on Nov. 22, 2021, 12:17 a.m.