cynkra / munch

Functions for working with the historicized list of communes of Switzerland.
https://munch.cynkra.com
6 stars 2 forks source link

Add new function: get_timeseries(data, col, mID_to, year_from, year_to, summarize_fun = sum, weight = NULL) #12

Open ThomasKnecht opened 4 years ago

ThomasKnecht commented 4 years ago

Allows to aggregate time series to the specified year_to municipality data.

Options for summarize_fun: sum, mean, median, min, max, ... Options for weight: NULL, population, area

Output: tibble with columns: year, value

Discussion: Add weight to output? (how much did each municipality contribute to the output value) e.g. additional column weight_info: "3 municipalities: 20%, 30%, 50%"

krlmlr commented 4 years ago

Do we still need this?