get_depths {CCAMLRGIS} | R Documentation |
Get depths of locations from a bathymetry raster
Description
Given a bathymetry raster and an input dataframe of point locations (given in decimal degrees),
computes the depths at these locations (values for the cell each point falls in). The accuracy is
dependent on the resolution of the bathymetry raster (see load_Bathy
to get high resolution data).
Usage
get_depths(Input, Bathy, NamesIn = NULL)
Arguments
Input |
dataframe with, at least, Latitudes and Longitudes.
If Latitude, Longitude, Variable 1, Variable 2, ... Variable x. |
Bathy |
bathymetry raster with the appropriate |
NamesIn |
character vector of length 2 specifying the column names of Latitude and Longitude fields in
the
|
Value
dataframe with the same structure as the Input
with an additional depth column 'd'
.
See Also
load_Bathy
, create_Points
,
create_Stations
, get_iso_polys
.
Examples
#Generate a dataframe
MyData=data.frame(Lat=PointData$Lat,
Lon=PointData$Lon,
Catch=PointData$Catch)
#get depths of locations
MyDataD=get_depths(Input=MyData,Bathy=SmallBathy())
#View(MyDataD)
plot(MyDataD$d,MyDataD$Catch,xlab='Depth',ylab='Catch',pch=21,bg='blue')