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:
When data_pred
is supplied and agg_adm = NULL
, the lowest admin unit of data_pred
is used
When both data_pred
and agg_adm
are NULL
, the lowest admin unit of data
is used
get_stay_data(data, data_pred = NULL, agg_adm = NULL)
data | generalized data frame described in |
---|---|
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 |
dataframe with same columns as travel_data_sim
data with columns for counts of travel/stay/total
Other data synthesis:
get_crossdist()
,
get_distance_matrix()
,
get_mob_matrix()
Other travel probability:
fit_prob_travel()
John Giles
stay_data <- get_stay_data(travel_data_sim, agg_adm=2)#>#>