countryCellRast: Return cell index values per country

Description Usage Arguments Value Author(s) See Also Examples

View source: R/countryCellRast.R

Description

This function returns a list of countries and all the cell indices of a raster to it. The output can for instance be used to access the cell values of individual countries. Function is based on the function cellFromPolygon from the raster package and only considers cells whose center is within the country's polygon.

Usage

1
countryCellRast(x, countries="DIVA GIS", rm.length0=T,  cache=T, writecache=T)

Arguments

x

Raster file where cell index values should be calculated for

countries

Dataset that is used to sperate between counties. Currently only polygons from 'DIVA GIS' supported

rm.length0

If TRUE, all countries with no associated cells are removed from the list

cache

If TRUE, will look if the output already exists in cache and read from there

writecache

If TRUE, will also store the newly calculated output in the cache folder

Value

List of countries named by their ISO codes with raster cell indices of each country

Author(s)

Ulrich Kreidenweis

See Also

countryFunRast

Examples

1
## Not run: countryCellRast()

pik-piam/geodata documentation built on Nov. 5, 2019, 12:21 a.m.