# NOT RUN {
library(oce)
# }
# NOT RUN {
## secchi depths in lat and lon bins
if (requireNamespace("ocedata", quietly=TRUE)) {
data(secchi, package="ocedata")
## Note that zlim is provided to the colormap(), to prevent a few
## points from setting a very wide scale.
cm <- colormap(z=secchi$depth, col=oceColorsViridis, zlim=c(0, 15))
par(mar=c(2, 2, 2, 2))
drawPalette(colormap=cm, zlab="Secchi Depth")
data(coastlineWorld)
mapPlot(coastlineWorld, longitudelim=c(-5, 20), latitudelim=c(50, 66),
grid=5, col='gray', projection="+proj=lcc +lat_1=50 +lat_2=65")
bc <- binApply2D(secchi$longitude, secchi$latitude,
pretty(secchi$longitude, 80),
pretty(secchi$latitude, 40),
f=secchi$depth, FUN=mean)
mapImage(bc$xmids, bc$ymids, bc$result, zlim=cm$zlim, col=cm$zcol)
mapPolygon(coastlineWorld, col="gray")
}
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab