as.glider | R Documentation |
This function returns a glider object that holds data as provided
in the data
argument, with units as provided by the units
argument. The units
argument is optional, making the function
easy to use in interactive sessions, but production code ought to
be written with units fully specified.
as.glider(type, data, units)
type |
Character value giving the type of glider, e.g.
be either |
data |
A data frame containing the data. This is copied straight into
the |
units |
A list holding units, with names corresponding to the
names in the data. See the example for the format to be used
for |
Dan Kelley
library(oceglider)
directory <- system.file("extdata/sea_explorer/delayed_raw", package = "oceglider")
g <- read.glider.seaexplorer.raw(directory, "pld1.raw", progressBar = FALSE)
data <- g[["data"]]
units <- list(
temperature = list(unit = expression(degree * C), scale = "ITS-90"),
salinity = list(unit = expression(), scale = "PSS-78"),
pressure = list(unit = expression(dbar), scale = ""),
longitude = list(unit = expression(degree * E), scale = ""),
latitude = list(unit = expression(degree * N), scale = "")
)
gg <- as.glider("seaexplorer", data, units)
par(mfrow = c(2, 1))
plot(g, which = "p")
plot(gg, which = "p")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.