Coerces a dataset (minimally, a sequence of times and heights) into a sealevel dataset. The arguments are based on the standard data format, as were described in a file formerly available at reference 1.
as.sealevel(
elevation,
time,
header = NULL,
stationNumber = NA,
stationVersion = NA,
stationName = NULL,
region = NULL,
year = NA,
longitude = NA,
latitude = NA,
GMTOffset = NA,
decimationMethod = NA,
referenceOffset = NA,
referenceCode = NA,
deltat
)
a list of sea-level heights in metres, in an hourly sequence.
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.
a character string as read from first line of a standard data file.
three-character string giving station number.
single character for version of station.
the name of station (at most 18 characters).
the name of the region or country of station (at most 19 characters).
the year of observation.
the longitude in decimal degrees, positive east of Greenwich.
the latitude in decimal degrees, positive north of the equator.
offset from GMT, in hours.
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.
?
?
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 times
is used. If this is not provided, and t
cannot be understood as a
time, then 1 hour is assumed.
A sealevel object (for details, see read.sealevel()
).
http://ilikai.soest.hawaii.edu/rqds/hourly.fmt
(this link
worked for years but failed at least temporarily on December 4, 2016).
The documentation for the sealevel class explains the structure of sealevel objects, and also outlines the other functions dealing with them.
Other things related to sealevel data:
[[,sealevel-method
,
[[<-,sealevel-method
,
plot,sealevel-method
,
read.sealevel()
,
sealevel-class
,
sealevelTuktoyaktuk
,
sealevel
,
subset,sealevel-method
,
summary,sealevel-method
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)
#> Sealevel Summary
#> ----------------
#>
#> * sampling delta-t: 1
#> * Location: Lat and lon unknown
#> * number of observations: 8761
#> * " non-missing: 8761
#> * Time: 0000-01-01 to 0000-12-31 (8761 samples, mean increment 1 hour)
#> * Data Overview
#>
#> Min. Mean Max. Dim. NAs
#> elevation [m] -2 0.00089588 2 8761 0
#> time 0000-01-01 0000-07-01 12:00:00 0000-12-31 8761 0
#>
#> * Processing Log
#>
#> - 2023-04-24 18:25:09 UTC: `create 'sealevel' object`
#> - 2023-04-24 18:25:09 UTC: `as.sealevel(elevation = elevation)`
# As above, but start at the Y2K time.
time <- as.POSIXct("2000-01-01") + h * 3600
sl <- as.sealevel(elevation, time)
summary(sl)
#> Sealevel Summary
#> ----------------
#>
#> * sampling delta-t: 1
#> * Location: Lat and lon unknown
#> * number of observations: 8761
#> * " non-missing: 8761
#> * Time: 2000-01-01 04:00:00 to 2000-12-31 04:00:00 (8761 samples, mean increment 1 hour)
#> * Data Overview
#>
#> Min. Mean Max. Dim. NAs
#> elevation [m] -2 0.00089588 2 8761 0
#> time 2000-01-01 04:00:00 2000-07-01 16:00:00 2000-12-31 04:00:00 8761 0
#>
#> * Processing Log
#>
#> - 2023-04-24 18:25:09 UTC: `create 'sealevel' object`
#> - 2023-04-24 18:25:09 UTC: `as.sealevel(elevation = elevation, time = time)`