Skip to contents

This function extracts region data for each location from a given shapefile. It also adds additional columns for day of week and training or testing data flag.

Usage

append_region_index(train_data, polys)

Arguments

train_data

A data frame containing training data.

polys

Shapefile object containing state boundaries and regions.

Value

Returns the modified train_data dataframe with new columns: day, trn_tst, and Region.

Examples

append_region_index(train_df, states_sf, as.Date("2020-12-31"))
#> Error in append_region_index(train_df, states_sf, as.Date("2020-12-31")): unused argument (as.Date("2020-12-31"))