EVOLUTION-MANAGER
Edit File: st_crop.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: crop an sf object to a specific rectangle</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 st_crop {sf}"><tr><td>st_crop {sf}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>crop an sf object to a specific rectangle</h2> <h3>Description</h3> <p>crop an sf object to a specific rectangle </p> <h3>Usage</h3> <pre> st_crop(x, y, ...) ## S3 method for class 'sfc' st_crop(x, y, ..., xmin, ymin, xmax, ymax) ## S3 method for class 'sf' st_crop(x, y, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>object of class <code>sf</code> or <code>sfc</code></p> </td></tr> <tr valign="top"><td><code>y</code></td> <td> <p>numeric vector with named elements <code>xmin</code>, <code>ymin</code>, <code>xmax</code> and <code>ymax</code>, or object of class <code>bbox</code>, or object for which there is an <a href="st_bbox.html">st_bbox</a> method to convert it to a <code>bbox</code> object</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>ignored</p> </td></tr> <tr valign="top"><td><code>xmin</code></td> <td> <p>minimum x extent of cropping area</p> </td></tr> <tr valign="top"><td><code>ymin</code></td> <td> <p>minimum y extent of cropping area</p> </td></tr> <tr valign="top"><td><code>xmax</code></td> <td> <p>maximum x extent of cropping area</p> </td></tr> <tr valign="top"><td><code>ymax</code></td> <td> <p>maximum y extent of cropping area</p> </td></tr> </table> <h3>Details</h3> <p>setting arguments <code>xmin</code>, <code>ymin</code>, <code>xmax</code> and <code>ymax</code> implies that argument <code>y</code> gets ignored. </p> <h3>Examples</h3> <pre> box = c(xmin = 0, ymin = 0, xmax = 1, ymax = 1) pol = st_sfc(st_buffer(st_point(c(.5, .5)), .6)) pol_sf = st_sf(a=1, geom=pol) plot(st_crop(pol, box)) plot(st_crop(pol_sf, st_bbox(box))) # alternative: plot(st_crop(pol, xmin = 0, ymin = 0, xmax = 1, ymax = 1)) </pre> <hr /><div style="text-align: center;">[Package <em>sf</em> version 0.9-5 <a href="00Index.html">Index</a>]</div> </body></html>