# NOT RUN {
#Generate a dataframe
MyData=data.frame(Lat=PointData$Lat,
Lon=PointData$Lon,
Catch=PointData$Catch)
#Example 1: 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') #Plot of catch vs depth
#Example 2: get depths of locations and distance to isobath -3000m
MyDataD=get_depths(Input=MyData,Bathy=SmallBathy,
Isobaths=-3000,IsoLocs=TRUE,d=200000,ShowProgress=TRUE)
plot(MyDataD$x,MyDataD$y,pch=21,bg='green')
raster::contour(SmallBathy,levels=-3000,add=TRUE,col='blue',maxpixels=10000000)
segments(x0=MyDataD$x,
y0=MyDataD$y,
x1=MyDataD$X_3000,
y1=MyDataD$Y_3000,col='red')
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab