Learn R Programming

epm (version 1.1.5)

coordsFromEpmGrid: Retrieve coordinates from epmGrid

Description

Return the centroid coordinates for a specified set of grid cells.

Usage

coordsFromEpmGrid(x, sites)

Value

matrix with x and y coordinates.

Arguments

x

object of class epmGrid

sites

locations of sites, see details.

Author

Pascal Title

Details

Sites can be cell indices as a numeric vector, or you can specify sites = 'all' to get all grid cells. If the epmGrid object is hexagon-based, then all grid cells that are occupied are returned. If the epmGrid is square-based, then all grid cells, occupied or empty, are returned.

Examples

Run this code
tamiasEPM

# from cell indices
cells <- c(2703, 90, 3112, 179)
coordsFromEpmGrid(tamiasEPM, cells)

# for all grid cells
dim(coordsFromEpmGrid(tamiasEPM, 'all'))


Run the code above in your browser using DataLab