dy_DepthTS | R Documentation |
plot time series data (e.g. depth or temperature time series data from archival tags) via the dygraphs interactive time series plotting interface.
dy_TS(ts_df, y="Depth", xlim, ylim,
ylab=y, xlab, main,
ID, ID_label="Serial",
plot_DayTimePeriods=TRUE, twilight.set="ast",
color="darkblue",
doRangeSelector=TRUE, drawPoints=FALSE, pointSize=2, tz="UTC",...)
dy_DepthTS(ts_df, y="Depth", xlim, ylim,
ylab=y, xlab, main,
ID, ID_label="Serial",
plot_DayTimePeriods=TRUE, twilight.set="ast",
color="darkblue",
doRangeSelector=TRUE, drawPoints=FALSE, pointSize=2, tz="UTC", ...)
ts_df |
data.frame holding the time series data to be plotted, including the x-vector 'datetime' (in |
y |
character label of time series vector to be plotted (by default 'Depth'). |
xlim |
the x limits (x1, x2) of the plot (by default range(ts_df$datetime), but needs to be specified in |
ylim |
the y limits of the plot (by default range(ts_df[[y]]), but needs to be specified in |
ylab, xlab |
the y- and x-axis labels. |
main |
main title (by default "Tag ID") for the plot). |
ID, ID_label |
Tag ID and its label (column name; by default "Serial") to be selected (e.g. if input data frame holds tagging data from several tags). |
plot_DayTimePeriods, twilight.set |
whether day-time periods ('Night', 'Dawn', 'Day', 'Dusk') should be plotted as shaded areas. In case that |
color |
color of the line to be plotted (by default "darkblue") |
doRangeSelector |
whether to add dygraph interactive range selection and zooming bar below the figure (by default |
drawPoints, pointSize |
Whether to indicate add points to the figure at the sampling time steps as well their size. |
tz |
The time zone in which the data should be illustrated (By default "UTC"). ATTENTION: The required date format of the input data is "UTC" (across all RchivalTag-functions). Run |
... |
additional arguments to be passed to dygraph.Further arguments can be passed after the function call, e.g. via dyOptions. |
An interactive dygraph plot object that can be altered further using for exemple the dyOptions.
Robert K. Bauer
plot_TS, plot_DepthTempTS
### load sample depth and temperature time series data from miniPAT:
# ts_file <- system.file("example_files/104659-Series.csv",package="RchivalTag")
# ts_df <- read_TS(ts_file)
# ts_df$Serial <- ts_df$DeployID
# head(ts_df)
## plot depth-time series data
# dy_DepthTS(ts_df)
## add missing Lon, Lat information for night-time and twilight shadings
# ts_df$Lon <- 5; ts_df$Lat <- 43
# dy_DepthTS(ts_df)
## same figure with plot_DepthTS:
# plot_DepthTS(ts_df, plot_DayTimePeriods = TRUE)
## some further arguments:
# dy_DepthTS(ts_df, xlim = unique(ts_df$date)[2:3], plot_DayTimePeriods = FALSE)
## add further options via dyOptions-call:
# dg <- dy_DepthTS(ts_df, xlim = unique(ts_df$date)[2:3],
# plot_DayTimePeriods = FALSE, drawPoints = TRUE)
# dg <- dyOptions(dg,drawGrid=FALSE)
# dg
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.