library(oce)
# Construct a year of M2 tide, starting at the default time
# 0000-01-01T00:00:00.
h <- seq(0, 24 * 365)
elevation <- 2.0 * sin(2 * pi * h / 12.4172)
sl <- as.sealevel(elevation)
summary(sl)
# As above, but start at the Y2K time.
time <- as.POSIXct("2000-01-01") + h * 3600
sl <- as.sealevel(elevation, time)
summary(sl)
Run the code above in your browser using DataLab