EVOLUTION-MANAGER
Edit File: SpatialPixelsDataFrame-class.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: Class "SpatialPixelsDataFrame"</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 SpatialPixelsDataFrame-class {sp}"><tr><td>SpatialPixelsDataFrame-class {sp}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Class "SpatialPixelsDataFrame" </h2> <h3>Description</h3> <p> Class for spatial attributes that have spatial locations on a regular grid. </p> <h3>Objects from the Class</h3> <p>Objects can be created by calls of the form <code>as(x, "SpatialPixelsDataFrame")</code>, where <code>x</code> is of class <a href="SpatialPointsDataFrame-class.html">SpatialPointsDataFrame-class</a>, or by importing through rgdal. Ordered full grids are stored instead or unordered non-NA cells; </p> <h3>Slots</h3> <dl> <dt><code>bbox</code>:</dt><dd><p>Object of class <code>"matrix"</code>; bounding box </p> </dd> <dt><code>proj4string</code>:</dt><dd><p>Object of class <code>"CRS"</code>; projection </p> </dd> <dt><code>coords</code>:</dt><dd><p>see <a href="SpatialPoints.html">SpatialPoints</a>; points slot </p> </dd> <dt><code>coords.nrs</code></dt><dd><p>see <a href="SpatialPoints.html">SpatialPointsDataFrame</a></p> </dd> <dt><code>grid</code>:</dt><dd><p>see <a href="GridTopology-class.html">GridTopology-class</a>; grid parameters </p> </dd> <dt><code>grid.index</code>:</dt><dd><p>integer; index of points in the list to points in the full (ordered) grid. x cycles fastest; all coordinates increase from low to hight except y, which decreases from high to low </p> </dd> <dt><code>data</code>:</dt><dd><p>Object of class data.frame, containing the attribute data </p> </dd> </dl> <h3>Extends</h3> <p>Class <code>"SpatialPixels"</code>, directly. Class <code>"Spatial"</code>, by class <code>"SpatialPixels"</code>. </p> <h3>Methods</h3> <dl> <dt>coordinates</dt><dd><p><code>signature(x = "SpatialPixelsDataFrame")</code>: retrieves coordinates </p> </dd> <dt>[</dt><dd><p><code>signature(x = "SpatialPixelsDataFrame")</code>: selects row(s) and/or attribute(s), and returns an object of class <code>SpatialPixelsDataFrame</code>; rows refer here to the pixel numbers, not grid lines. For selecting a square block in a grid, coerce to a <a href="SpatialGridDataFrame-class.html">SpatialGridDataFrame-class</a> first, and use <code>[</code> on that object</p> </dd> <dt>as.matrix</dt><dd><p><code>signature(x = "SpatialPixelsDataFrame")</code>: coerce to matrix </p> </dd> <dt>rbind</dt><dd><p><code>signature(x = "SpatialPixelsDataFrame")</code>: rbind-like method </p> </dd> <dt>plot</dt><dd><p><code>signature(x = "SpatialPixelsDataFrame", y = "missing")</code>: see <a href="SpatialGridDataFrame-class.html">SpatialGridDataFrame-class</a> for details</p> </dd> </dl> <h3>Author(s)</h3> <p> Edzer Pebesma, <a href="mailto:edzer.pebesma@uni-muenster.de">edzer.pebesma@uni-muenster.de</a> </p> <h3>See Also</h3> <p><code><a href="SpatialPixels-class.html">SpatialPixels-class</a></code>, which does not contain the attribute data </p> <h3>Examples</h3> <pre> data(meuse.grid) # only the non-missing valued cells coordinates(meuse.grid) = c("x", "y") # promote to SpatialPointsDataFrame gridded(meuse.grid) <- TRUE # promote to SpatialPixelsDataFrame meuse.grid[["idist"]] = 1 - meuse.grid[["dist"]] # assigns new attribute image(meuse.grid["idist"]) # note the single [ # toy example: df = data.frame(z = c(1:6,NA,8,9), xc = c(1,1,1,2,2,2,3,3,3), yc = c(rep(c(0, 1.5, 3),3))) coordinates(df) = ~xc+yc gridded(df) = TRUE image(df["z"]) # draw labels to verify: cc = coordinates(df) z=df[["z"]] zc=as.character(z) zc[is.na(zc)]="NA" text(cc[,1],cc[,2],zc) </pre> <hr /><div style="text-align: center;">[Package <em>sp</em> version 1.4-2 <a href="00Index.html">Index</a>]</div> </body></html>