| rarify | R Documentation |
Reduce density of mapped depth data to improve accuracy and computation time.
rarify(outline, df, x, y, z, res = 10)
outline |
shapefile outline of a waterbody. Accepts a SpatVector, an sf object, or anything terra::vect() can read. |
df |
dataframe of coordinates and depths for a given waterbody. Coordinates are assumed to be in the same CRS as 'outline'. |
x |
character giving name of longitude column |
y |
character giving name of latitude column |
z |
character giving name of depth column |
res |
number describing the target spacing between rarified points, in meters, default = 10 |
The function automatically detects whether 'outline' (and therefore 'df') is in a geographic (decimal degree) or projected (meters) coordinate system, the same way interpBathy() does. If geographic, points are rarified in the waterbody's best-fit UTM zone so that 'res' is honored as a true physical spacing in meters, then the rarified points are returned in the original CRS of 'outline'.
dataframe of rarified xyz coordinates (columns named 'x', 'y', 'z' regardless of the input column names), in the same CRS as the original input
Sean Bertalot & Tristan Blechinger, Department of Zoology & Physiology, University of Wyoming
outline <- terra::vect(system.file("extdata", "example_outline.shp", package = 'rLakeHabitat'))
depths <- read.csv(system.file("extdata", "example_depths.csv", package = 'rLakeHabitat'))
rarify(outline = outline, df = depths, x = "x", y = "y", z = "z", res = 100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.