Learn R Programming

oce (version 0.2-1)

as.sealevel: Coerce data into sea-level dataset

Description

Coerces a dataset (minimally, a sequence of times and heights) into a sealevel dataset.

Usage

as.sealevel(elevation,  time,  header=NULL,
  stationNumber=NA, stationVersion=NA, stationName=NULL,
  region=NULL, year=NA, latitude=NA, longitude=NA, GMTOffset=NA,
  decimationMethod=NA, referenceOffset=NA, referenceCode=NA, deltat)

Arguments

elevation
a list of sea-level heights in metres, in an hourly sequence.
time
optional list of times, in POSIXct format. If missing, the list will be constructed assuming hourly samples, starting at 0000-01-01 00:00:00.
header
a character string as read from first line of a standard data file.
stationNumber
three-character string giving station number.
stationVersion
single character for version of station.
stationName
the name of station (at most 18 characters).
region
the name of the region or country of station (at most 19 characters).
year
the year of observation.
latitude
the latitude in decimal degrees, positive north of the equator.
longitude
the longitude in decimal degrees, positive east of Greenwich.
GMTOffset
offset from GMT, in hours.
decimationMethod
a coded value, with 1 meaning filtered, 2 meaning a simple average of all samples, 3 meaning spot readings, and 4 meaning some other method.
referenceOffset
?
referenceCode
?
deltat
optional interval between samples, in hours (as for the ts timeseries function). If this is not provided, and t can be understood as a time, then the difference between the first two tim

Value

Details

The arguments are based on the standard data format, as described at ftp://ilikai.soest.hawaii.edu/rqds/hourly.fmt.

References

ftp://ilikai.soest.hawaii.edu/rqds/hourly.fmt.

See Also

Sealevel data may be read with read.sealevel and summarized with summary.sealevel. Use Summary plots are created with plot.sealevel. Tidal models may be fitted to sealevel data with tidem. Sample sea-level data sets are provided with data(sealevelHalifax) and data(sealevelTuktoyaktuk).

Examples

Run this code
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