Learn R Programming

rLakeHabitat (version 1.0.0)

rarify: Rarify Depth Data

Description

Reduce density of mapped depth data to improve accuracy and computation time.

Usage

rarify(outline, df, x, y, z, res = 10, crsUnits = "dd")

Value

dataframe of rarified xyz coordinates

Arguments

outline

shapefile outline of a waterbody

df

dataframe of coordinates and depths for a given waterbody

x

character giving name of longitude column

y

character giving name of latitude column

z

character giving name of depth column

res

number describing by how much to increase point resolution, default = 10

crsUnits

character describing CRS units of input outline, either "dd" (decimal degrees) or "m" (meters), default = "dd"

Author

Sean Bertalot & Tristan Blechinger, Department of Zoology & Physiology, University of Wyoming

Examples

Run this code
#load test data
outline <- terra::vect(system.file("extdata", "example_outline.shp", package = 'rLakeHabitat'))
depths <- read.csv(system.file("extdata", "example_depths.csv", package = 'rLakeHabitat'))
#run function
rarify(outline = outline, df = depths, x = "x", y = "y", z = "z", res = 100, crsUnits = "dd")

Run the code above in your browser using DataLab