vector_to_pg: vector_to_pg

Description Usage Arguments Value

View source: R/utility_functions.R

Description

Converts a sf data frame to PRIO-GRID as a crossection.

Usage

1
vector_to_pg(sfdf, variable, fun, need_aggregation = TRUE, missval = -1)

Arguments

sfdf

a sf (simple features) data frame

variable

the variable to convert to PRIO-GRID

fun

aggregation function. only used if need_aggregation is TRUE.

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.

Value

A raster with same extent and crs as PRIO-GRID.


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