if(interactive()){
# import copernicus data with potential temperatures and ocean current velocities
oc <- read.cmems("global-reanalysis-phy-001-030-daily_1560792767602_GC_2013-14.nc")
vel <- velocity(u = oc$uo, v = oc$vo)
# Plots overlaying velocity vectors
plot(vel$speed)
quiver(u = oc$uo, v = oc$vo, main = "", length=0.02, scale = 0.7, add2map = TRUE)
plot(vel$rhumb, col.sep = 90, scheme = c('#d7301f', '#fc8d59','#fdcc8a', '#fef0d9'))
quiver(u = oc$uo, v = oc$vo, main = "", add2map = TRUE)
}
Run the code above in your browser using DataLab