EVOLUTION-MANAGER
Edit File: clump.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: Detect clumps</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 clump {raster}"><tr><td>clump {raster}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Detect clumps</h2> <h3>Description</h3> <p>Detect clumps (patches) of connected cells. Each clump gets a unique ID. NA and zero are used as background values (i.e. these values are used to separate clumps). You can use queen's or rook's case, using the <code>directions</code> argument. For larger files that are processed in chunks, the highest clump number is not necessarily equal to the number of clumps (unless you use argument <code>gaps=FALSE</code>). </p> <h3>Usage</h3> <pre> ## S4 method for signature 'RasterLayer' clump(x, filename="", directions=8, gaps=TRUE, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>RasterLayer</p> </td></tr> <tr valign="top"><td><code>filename</code></td> <td> <p>Character. Filename for the output RasterLayer (optional)</p> </td></tr> <tr valign="top"><td><code>directions</code></td> <td> <p>Integer. Which cells are considered adjacent? Should be 8 (Queen's case) or 4 (Rook's case) </p> </td></tr> <tr valign="top"><td><code>gaps</code></td> <td> <p>Logical. If <code>TRUE</code> (the default), there may be 'gaps' in the chunk numbers (e.g. you may have clumps with IDs 1, 2, 3 and 5, but not 4). If it is <code>FALSE</code>, these numbers will be recoded from 1 to n (4 in this example)</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Additional arguments as for <code><a href="writeRaster.html">writeRaster</a></code></p> </td></tr> </table> <h3>Value</h3> <p>RasterLayer </p> <h3>Note</h3> <p>This function requires that the igraph package is available. </p> <h3>Author(s)</h3> <p>Robert J. Hijmans and Jacob van Etten</p> <h3>Examples</h3> <pre> r <- raster(ncols=12, nrows=12) set.seed(0) values(r) <- round(runif(ncell(r))*0.7 ) rc <- clump(r) freq(rc) plot(rc) </pre> <hr /><div style="text-align: center;">[Package <em>raster</em> version 3.3-13 <a href="00Index.html">Index</a>]</div> </body></html>