EVOLUTION-MANAGER
Edit File: cellsFromExtent.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Cells from extent, and vice versa</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for cellsFromExtent {raster}"><tr><td>cellsFromExtent {raster}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Cells from extent, and vice versa</h2> <h3>Description</h3> <p>cellsFromExtent returns the cell numbers for a Raster* object that are within a specfied extent (rectangular area), supply an object of class Extent, or another Raster* object. </p> <p>extentFromCells returns an Extent object from a Raster* object and cell numbers. All cells are within the returned Extent. </p> <h3>Usage</h3> <pre> cellsFromExtent(object, extent, expand=FALSE) extentFromCells(object, cells) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>object</code></td> <td> <p>A Raster* object</p> </td></tr> <tr valign="top"><td><code>extent</code></td> <td> <p>An object of class Extent (which you can create with newExtent(), or another Raster* object )</p> </td></tr> <tr valign="top"><td><code>expand</code></td> <td> <p>Logical. If <code>TRUE</code>, <code>NA</code> is returned for (virtual) cells implied by <code>bndbox</code>, that are outside the RasterLayer (<code>object</code>). If <code>FALSE</code>, only cell numbers for the area where <code>object</code> and <code>bndbox</code> overlap are returned (see <a href="intersect.html">intersect</a>) </p> </td></tr> <tr valign="top"><td><code>cells</code></td> <td> <p>numeric. A vector of cell numbers</p> </td></tr> </table> <h3>Value</h3> <p>a vector of cell numbers </p> <h3>See Also</h3> <p><code><a href="extent.html">extent</a></code>, <code><a href="cellFrom.html">cellFromXY</a></code> </p> <h3>Examples</h3> <pre> r <- raster() bb <- extent(-5, 5, -5, 5) cells <- cellsFromExtent(r, bb) r <- crop(r, bb) values(r) <- cells e <- extentFromCells(r, 50:55) </pre> <hr /><div style="text-align: center;">[Package <em>raster</em> version 3.3-13 <a href="00Index.html">Index</a>]</div> </body></html>