EVOLUTION-MANAGER
Edit File: st_jitter.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: jitter geometries</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_jitter {sf}"><tr><td>st_jitter {sf}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>jitter geometries</h2> <h3>Description</h3> <p>jitter geometries </p> <h3>Usage</h3> <pre> st_jitter(x, amount, factor = 0.002) </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>amount</code></td> <td> <p>numeric; amount of jittering applied; if missing, the amount is set to factor * the bounding box diagonal; units of coordinates.</p> </td></tr> <tr valign="top"><td><code>factor</code></td> <td> <p>numeric; fractional amount of jittering to be applied</p> </td></tr> </table> <h3>Details</h3> <p>jitters coordinates with an amount such that <code>runif(1, -amount, amount)</code> is added to the coordinates. x- and y-coordinates are jittered independently but all coordinates of a single geometry are jittered with the same amount, meaning that the geometry shape does not change. For longlat data, a latitude correction is made such that jittering in East and North directions are identical in distance in the center of the bounding box of <code>x</code>. </p> <h3>Examples</h3> <pre> nc = read_sf(system.file("gpkg/nc.gpkg", package="sf")) pts = st_centroid(st_geometry(nc)) plot(pts) plot(st_jitter(pts, .05), add = TRUE, col = 'red') plot(st_geometry(nc)) plot(st_jitter(st_geometry(nc), factor = .01), add = TRUE, col = '#ff8888') </pre> <hr /><div style="text-align: center;">[Package <em>sf</em> version 0.9-5 <a href="00Index.html">Index</a>]</div> </body></html>