Description Usage Arguments Details Value Examples
View source: R/sf_aggregate_lst.R
Tidy the data and merges data accordingly to a time range and by the values concerned by a split/merge/rename event and return a sf data frame for the time range imputed.
1 | sf_aggregate_lst(df_sf, history_lst, from, to = "2018-12-31")
|
df_sf |
A sf data frame containing at least the variables
|
history_lst |
A list containing a list of event, each code with a slot
|
from |
Initial date of the time range selected for the admin1
definition, of the class |
to |
Final date of the time range selected for the admin1
definition, of the class |
For each 'split event', the geometry of the variables contained in the slot 'after' is combined and rename by the variable in the slot 'before'. For each 'rename event', the variable contained in the slot 'after' is renamed. In the new rows, <NA> will be added in the other column than 'sel' and 'geometry'
A object of the same class as df_sf
in which all the variables
and geometry that needed to be aggregated or renamed (according to the time
range) are changed.
1 2 3 4 5 6 7 | # to have the list of split/merge/rename event for Vietnam
vn_history <- dictionary::vn_history
vn_prov04 <- gadmVN::gadm(date = "2004-01-01")
names(vn_prov04)[1] <- "admin1"
vn_prov70 <- sf_aggregate_lst(vn_prov04, vn_history, from = "1970",
to = "2004")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.