| dy_DepthTS | R Documentation |
Plot time series data (e.g. depth or temperature time series from archival tags) via the dygraphs interactive 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' ( |
y |
Character label of the time series vector to be plotted (default "Depth"). |
xlim |
X-axis limits (x1, x2) of the plot (default range(ts_df$datetime), but can be specified in |
ylim |
Y-axis limits (default range(ts_df[[y]]), but can be specified in |
ylab, xlab |
Axis labels. |
main |
Main title (default "Tag ID"). |
ID, ID_label |
Tag ID and column label (default "Serial"). |
plot_DayTimePeriods, twilight.set |
Whether day-time periods ("Night", "Dawn", "Day", "Dusk") should be shaded. If |
color |
Line color (default "darkblue"). |
doRangeSelector |
Whether to add dygraph interactive range selector (default TRUE). |
drawPoints, pointSize |
Whether to draw points at sampling times and their size. |
tz |
Time zone for the plot (default "UTC"). |
... |
Additional arguments passed to dygraph. Further arguments can be passed via dyOptions. |
An interactive dygraph plot object that can be altered further using dyOptions.
Robert K. Bauer
plot_TS, plot_DepthTempTS, dygraph, dyOptions
### 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 info for day/night shading
# ts_df$Lon <- 5; ts_df$Lat <- 43
# dy_DepthTS(ts_df)
## same figure with plot_DepthTS
# plot_DepthTS(ts_df, plot_DayTimePeriods=TRUE)
## further arguments
# dy_DepthTS(ts_df, xlim=unique(ts_df$date)[2:3], plot_DayTimePeriods=FALSE)
## add further options via dyOptions
# 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.