EVOLUTION-MANAGER
Edit File: getValuesFocal.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: Get focal raster cell values</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 getValuesFocal {raster}"><tr><td>getValuesFocal {raster}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Get focal raster cell values</h2> <h3>Description</h3> <p>This function returns a matrix (or matrices) for all focal values of a number of rows of a Raster* object</p> <h3>Usage</h3> <pre> ## S4 method for signature 'Raster' getValuesFocal(x, row, nrows, ngb, names=FALSE, padValue=NA, array=FALSE, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>Raster* object</p> </td></tr> <tr valign="top"><td><code>row</code></td> <td> <p>Numeric. Row number, should be between 1 and nrow(x). Can be omitted to get all rows</p> </td></tr> <tr valign="top"><td><code>nrows</code></td> <td> <p>Numeric. Number of rows, should be a positive integer smaller than <code>row+nrow(x)</code>. Should be omitted if <code>row</code> is omitted</p> </td></tr> <tr valign="top"><td><code>ngb</code></td> <td> <p>Neighbourhood size. Either a single integer or a vector of two integers <code>c(nrow, ncol)</code></p> </td></tr> <tr valign="top"><td><code>names</code></td> <td> <p>logical. If <code>TRUE</code>, the matrix returned has row and column names</p> </td></tr> <tr valign="top"><td><code>padValue</code></td> <td> <p>numeric. The value of the cells of the "padded" rows and columns. That is 'virtual' values for cells within a neighbourhood, but outside the raster</p> </td></tr> <tr valign="top"><td><code>array</code></td> <td> <p>logical. If <code>TRUE</code> and <code>x</code> has multiple layers, an array is returned in stead of a list of matrices</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>additional arguments (none implemented)</p> </td></tr> </table> <h3>Value</h3> <p>If <code>x</code> has a single layer, a matrix with one row for each focal cell, and one column for each neighbourhood cell around it. </p> <p>If <code>x</code> has multiple layers, an array (if <code>array=TRUE</code>) or a list of such matrices (one list element (matrix) for each layer) </p> <h3>See Also</h3> <p><code><a href="getValues.html">getValues</a>, <a href="focal.html">focal</a></code> </p> <h3>Examples</h3> <pre> r <- raster(nr=5, nc=5, crs='+proj=utm +zone=12') values(r) <- 1:25 as.matrix(r) getValuesFocal(r, row=1, nrows=2, ngb=3, names=TRUE) getValuesFocal(stack(r,r), row=1, nrows=1, ngb=3, names=TRUE, array=TRUE) </pre> <hr /><div style="text-align: center;">[Package <em>raster</em> version 3.3-13 <a href="00Index.html">Index</a>]</div> </body></html>