tidem(t, x, constituents, latitude=NULL, rc=1, regress=lm,
      debug =getOption("oceDebug"))sealevel object (e.g. produced by
    read.sealevel or as.sealevel) or a vector of
    times. In the former case, time is part is a sealevel-class object, in
    which case it is inferred as t[["elevation"]]tidem will try to infer this from sl.lm, but could be for example rlm from the
    class "tide", consisting ofZ0, 1 for SA, etc.M2".p value may make no sense at all, and it might
      be removed in a future version of this function. Perhaps a significance
      level should be presented, as in the software developed by both Foreman
      and Pawlowicz.}
constituents is not provided, then the constituent
      list will be made up of the 69 constituents regarded by Foreman as
      standard.  These include astronomical frequencies and some shallow-water
      frequencies, and are as follows: c("Z0", "SA", "SSA", "MSM", "MM",
        "MSF", "MF", "ALP1", "2Q1", "SIG1", "Q1", "RHO1", "O1", "TAU1", "BET1",
        "NO1", "CHI1", "PI1", "P1", "S1", "K1", "PSI1", "PHI1", "THE1", "J1",
        "SO1", "OO1", "UPS1", "OQ2", "EPS2", "2N2", "MU2", "N2", "NU2", "GAM2",
        "H1", "M2", "H2", "MKS2", "LDA2", "L2", "T2", "S2", "R2", "K2", "MSN2",
        "ETA2", "MO3", "M3", "SO3", "MK3", "SK3", "MN4", "M4", "SN4", "MS4",
        "MK4", "S4", "SK4", "2MK5", "2SK5", "2MN6", "M6", "2MS6", "2MK6",
        "2SM6", "MSK6", "3MK7", "M8").}    constituents is the string
      "standard", then a provisional list is set up as in Case 1, and
      then the (optional) rest of the elements of constituents are
      examined, in order.  Each of these constituents is based on the name of a
      tidal constituent in the Foreman (1977) notation.  (To get the list,
      execute data(tideData) and then execute cat(tideData$name).)
      Each named constituent is added to the existing list, if it is not already
      there.  But, if the constituent is preceeded by a minus sign, then it is
      removed from the list (if it is already there).  Thus, for example,
      constituents=c("standard", "-M2", "ST32") would remove the M2
      constituent and add the ST32 constituent.}
    "standard", then the list of
      constituents is processed as in Case 2, but without starting with the
      standard list. As an example, constituents=c("K1", "M2") would fit
      for just the K1 and M2 components. (It would be strange to use a minus
      sign to remove items from the list, but the function allows that.)}
    In each of the above cases, the list is reordered in frequency prior to the
    analysis, so that the results of summary.tidem will be in a
    familiar form.
    Once the constituent list is determined, tidem prunes the elements of
    the list by using the Rayleigh criterion, according to which two
    constituents of frequencies $f_1$ and $f_2$ cannot be
    resolved unless the time series spans a time interval of at least
    $rc/(f_1-f_2)$. The value rc=1 yields nominal
    resolution.
A list of constituent names is created by the following: data(tidedata) print(tidedata$const$name)
The text should include discussion of the (not yet performed) nodal correction treatement.
  Leffler, K. E. and D. A. Jay, 2009.
  Enhancing tidal harmonic analysis: Robust (hybrid) solutions.
  Continental Shelf Research, 29(1):78-88.
  
  Pawlowicz, Rich, Bob Beardsley, and Steve Lentz, 2002.
  Classical tidal harmonic analysis including error estimates in MATLAB using T_TIDE.
  Computers and Geosciences, 28, 929-937.
summary.tidem summarizes a "tide" object,
  plot.tidem plots one, and predict.tidem
  makes predictions from one.  As for the input, sealevel objects may be
  created with as.sealevel or read.sealevel.  See
  notes at sealevelTuktoyaktuk, which is test data set.library(oce)
# The demonstration time series from Foreman (1977),
# also used in T_TIDE (Pawlowicz, 2002).
data(sealevelTuktoyaktuk)
tide <- tidem(sealevelTuktoyaktuk)
summary(tide)
# AIC analysis
extractAIC(tide[["model"]])
# Fake data at M2
t <- seq(0, 10*86400, 3600)
eta <- sin(0.080511401 * t * 2 * pi / 3600)
sl <- as.sealevel(eta)
m <- tidem(sl)
summary(m)Run the code above in your browser using DataLab