panel_to_pg: panel_to_pg

Description Usage Arguments Value

View source: R/utility_functions.R

Description

Converts a sf data frame with panel data to PRIO-GRID.

Usage

1
panel_to_pg(df, timevar, variable, need_aggregation, missval, fun)

Arguments

df

a sf (simple features) data frame with panel data

timevar

the temporal variable (used to split data into crossections)

variable

the variable to convert to PRIO-GRID

need_aggregation

if FALSE, will use velox, which only extracts the last value for each feature. fast when applicable.

missval

only used if need_aggregation is FALSE. velox sets missing data to this value.

fun

aggregation function. only used if need_aggregation is TRUE.

Value

A tibble with x, y, pgid, timevar, and variable.


prio-data/priogrid documentation built on June 28, 2021, 5:34 a.m.