EVOLUTION-MANAGER
Edit File: SpatialPointsDataFrame-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 "SpatialPointsDataFrame"</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 SpatialPointsDataFrame-class {sp}"><tr><td>SpatialPointsDataFrame-class {sp}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Class "SpatialPointsDataFrame" </h2> <h3>Description</h3> <p> Class for spatial attributes that have spatial point locations </p> <h3>Usage</h3> <pre> ## S4 method for signature 'SpatialPointsDataFrame' x[i, j, ..., drop = TRUE] ## S4 method for signature 'SpatialPointsDataFrame,SpatialPoints' coerce(from, to, strict=TRUE) ## S4 method for signature 'SpatialPointsDataFrame,data.frame' coerce(from, to, strict=TRUE) ## S4 method for signature 'SpatialPointsDataFrame' coordinates(obj) ## S4 method for signature 'SpatialPointsDataFrame' show(object) ## S4 method for signature 'SpatialPointsDataFrame' points(x) ## S3 method for class 'SpatialPointsDataFrame' rbind(...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x,from,obj,object</code></td> <td> <p><code>SpatialPointsDataFrame</code> object</p> </td></tr> <tr valign="top"><td><code>to</code></td> <td> <p>class to which to coerce</p> </td></tr> <tr valign="top"><td><code>strict</code></td> <td> <p>see <code><a href="../../methods/html/as.html">as</a></code></p> </td></tr> <tr valign="top"><td><code>i</code></td> <td> <p>row indices</p> </td></tr> <tr valign="top"><td><code>j</code></td> <td> <p>column indices</p> </td></tr> <tr valign="top"><td><code>drop</code></td> <td> <p>see <code><a href="../../base/html/Extract.html">Extract</a></code></p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>indices passed through</p> </td></tr> </table> <h3>Objects from the Class</h3> <p>Objects can be created by calls of the form <code>coordinates(x) = c("x", "y") </code>. or of the form <code>coordinates(x) = xy</code>; see <a href="coordinates.html">coordinates</a>. </p> <h3>Slots</h3> <dl> <dt><code>data</code>:</dt><dd><p>Object of class data.frame containing the attribute data (may or may not contain the coordinates in its columns) </p> </dd> <dt><code>coords</code>:</dt><dd><p>Object of class <code>"matrix"</code>; the coordinates matrix (points are rows in the matrix) </p> </dd> <dt><code>coords.nrs</code></dt><dd><p>Object of class logical; if TRUE, when the object was created the coordinates were retrieved from the data.frame, and hence stripped from it; after coercion to data.frame, e.g. by as.data.frame(x), coordinates will again be added (as first few columns) to the data.frame </p> </dd> <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 string</p> </dd> </dl> <h3>Extends</h3> <p>Class <code>"SpatialPoints"</code>, directly. Class <code>"Spatial"</code>, by class <code>"SpatialPoints"</code>. </p> <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="coordinates.html">coordinates</a></code>, <code><a href="SpatialPoints-class.html">SpatialPoints-class</a></code> </p> <h3>Examples</h3> <pre> data(meuse) xy = meuse[c("x", "y")] # retrieve coordinates as data.frame class(meuse) data(meuse) # reload data.frame coordinates(meuse) = c("x", "y") # specify column names class(meuse) data(meuse) # reload data.frame coordinates(meuse) = c(1, 2) # specify column names class(meuse) data(meuse) # reload data.frame coordinates(meuse) = ~x+y # formula class(meuse) data(meuse) # reload data.frame coordinates(meuse) = xy # as data frame class(meuse) data(meuse) # reload data.frame coordinates(meuse) = as.matrix(xy) # as matrix meuse$log.zn = log(meuse$zinc) class(meuse) dim(meuse) </pre> <hr /><div style="text-align: center;">[Package <em>sp</em> version 1.4-2 <a href="00Index.html">Index</a>]</div> </body></html>