EVOLUTION-MANAGER
Edit File: cover.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: Replace NA values with values of other layers</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 cover {raster}"><tr><td>cover {raster}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Replace NA values with values of other layers </h2> <h3>Description</h3> <p>For Raster* objects: Replace <code>NA</code> values in the first Raster object (<code>x</code>) with the values of the second (<code>y</code>), and so forth for additional Rasters. If <code>x</code> has multiple layers, the subsequent Raster objects should have the same number of layers, or have a single layer only (which will be recycled). </p> <p>For SpatialPolygons* objects: Areas of <code>x</code> that overlap with <code>y</code> are replaced by (or intersected with) <code>y</code>. </p> <h3>Usage</h3> <pre> ## S4 method for signature 'RasterLayer,RasterLayer' cover(x, y, ..., filename='') ## S4 method for signature 'RasterStackBrick,Raster' cover(x, y, ..., filename='') ## S4 method for signature 'SpatialPolygons,SpatialPolygons' cover(x, y, ..., identity=FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>Raster* or SpatialPolygons* object</p> </td></tr> <tr valign="top"><td><code>y</code></td> <td> <p>Same as <code>x</code></p> </td></tr> <tr valign="top"><td><code>filename</code></td> <td> <p>character. Output filename (optional)</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Same as <code>x</code>. If <code>x</code> is a Raster* object, also additional arguments as for <code><a href="writeRaster.html">writeRaster</a></code></p> </td></tr> <tr valign="top"><td><code>identity</code></td> <td> <p>logical. If <code>TRUE</code> overlapping areas are intersected rather than replaced</p> </td></tr> </table> <h3>Value</h3> <p>RasterLayer or RasterBrick object, or SpatialPolygons object </p> <h3>Examples</h3> <pre> # raster objects r1 <- raster(ncols=36, nrows=18) values(r1) <- 1:ncell(r1) r2 <- setValues(r1, runif(ncell(r1))) r2[r2 < 0.5] <- NA r3 <- cover(r2, r1) #SpatialPolygons if (require(rgdal) & require(rgeos)) { p <- shapefile(system.file("external/lux.shp", package="raster")) b <- as(extent(6, 6.4, 49.75, 50), 'SpatialPolygons') crs(b) <- crs(p) b <- SpatialPolygonsDataFrame(b, data.frame(ID_1=9)) cv1 <- cover(p, b) cv2 <- cover(p, b, identity=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>