get_depths {CCAMLRGIS} | R Documentation |
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).
get_depths(Input, Bathy, NamesIn = NULL)
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
|
dataframe with the same structure as the Input
with an additional depth column 'd'
.
load_Bathy
, create_Points
,
create_Stations
, get_iso_polys
.
#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')