EVOLUTION-MANAGER
Edit File: SpatialMultiPoints.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: create objects of class SpatialMultiPoints or...</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 SpatialMultiPoints {sp}"><tr><td>SpatialMultiPoints {sp}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> create objects of class SpatialMultiPoints or SpatialMultiPointsDataFrame</h2> <h3>Description</h3> <p> create objects of class <a href="SpatialMultiPoints-class.html">SpatialMultiPoints-class</a> or <a href="SpatialMultiPointsDataFrame-class.html">SpatialMultiPointsDataFrame-class</a> from coordinates, and from coordinates and <code>data.frame</code>s</p> <h3>Usage</h3> <pre> SpatialMultiPoints(coords, proj4string=CRS(as.character(NA)), bbox = NULL) SpatialMultiPointsDataFrame(coords, data, proj4string = CRS(as.character(NA)), match.ID, bbox = NULL) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>coords</code></td> <td> <p>list with in each element a numeric matrix or data.frame with coordinates (each row representing a point); in case of SpatialMultiPointsDataFrame an object of class <a href="SpatialMultiPoints-class.html">SpatialMultiPoints-class</a> is also allowed</p> </td></tr> <tr valign="top"><td><code>proj4string</code></td> <td> <p> projection string of class <a href="CRS-class.html">CRS-class</a></p> </td></tr> <tr valign="top"><td><code>bbox</code></td> <td> <p>bounding box matrix, usually NULL and constructed from the data, but may be passed through for coercion purposes if clearly needed</p> </td></tr> <tr valign="top"><td><code>data</code></td> <td> <p> object of class <code>data.frame</code>; the number of rows in <code>data</code> should equal the number of points in the <code>coords</code> object</p> </td></tr> <tr valign="top"><td><code>match.ID</code></td> <td> <p> logical or character; if missing, and <code>coords</code> and <code>data</code> both have row names, and their order does not correspond, matching is done by these row names and a warning is issued; this warning can be suppressed by setting <code>match.ID</code> to TRUE. If TRUE AND coords has non-automatic rownames (i.e., coerced to a matrix by <code>as.matrix</code>, <code>dimnames(coords)[[1]]</code> is not <code>NULL</code>), AND <code>data</code> has row.names (i.e. is a data.frame), then the <code>SpatialMultiPointsDataFrame</code> object is formed by matching the row names of both components, leaving the order of the coordinates in tact. Checks are done to see whether both row names are sufficiently unique, and all data are matched. If FALSE, coordinates and data are simply "glued" together, ignoring row names. If character: indicates the column in <code>data</code> with coordinates IDs to use for matching records. See examples below. </p> </td></tr> </table> <h3>Value</h3> <p><code>SpatialMultiPoints</code> returns an object of class <code>SpatialMultiPoints</code>; <code>SpatialMultiPointsDataFrame</code> returns an object of class <code>SpatialMultiPointsDataFrame</code>; </p> <h3>See Also</h3> <p><a href="coordinates.html">coordinates</a>, <a href="SpatialMultiPoints-class.html">SpatialMultiPoints-class</a>, <a href="SpatialMultiPointsDataFrame-class.html">SpatialMultiPointsDataFrame-class</a> </p> <h3>Examples</h3> <pre> cl1 = cbind(rnorm(3, 10), rnorm(3, 10)) cl2 = cbind(rnorm(5, 10), rnorm(5, 0)) cl3 = cbind(rnorm(7, 0), rnorm(7, 10)) mp = SpatialMultiPoints(list(cl1, cl2, cl3)) mpx = rbind(mp, mp) # rbind method plot(mp, col = 2, cex = 1, pch = 1:3) mp mp[1:2] print(mp, asWKT=TRUE, digits=3) mpdf = SpatialMultiPointsDataFrame(list(cl1, cl2, cl3), data.frame(a = 1:3)) mpdf mpdfx = rbind(mpdf, mpdf) # rbind method plot(mpdf, col = mpdf$a, cex = 1:3) as(mpdf, "data.frame") mpdf[1:2,] </pre> <hr /><div style="text-align: center;">[Package <em>sp</em> version 1.4-2 <a href="00Index.html">Index</a>]</div> </body></html>