The chart #316 and #317 gives an introduction to time series representation with the digraphs library. This page gives a more custom example based on real data (number of bikes located per day). Here is the graph and the code that allows to make it!
library(xts) # To make the convertion data-frame / xts format
# Read the data (hosted on the gallery website)
data=read.table("https://python-graph-gallery.com/wp-content/uploads/bike.csv", header=T, sep=",") %>% head(300)
# Since my time is currently a factor, I have to convert it to a date-time format!
data$datetime = ymd_hms(data$datetime)
# Then you can create the xts format, and thus use dygraph
don=xts(x = data$count, order.by = data$datetime)
dyOptions(labelsUTC = TRUE, fillGraph=TRUE, fillAlpha=0.1, drawGrid = FALSE, colors="#D8AE5A") %>%
dyCrosshair(direction = "vertical") %>%
dyHighlight(highlightCircleSize = 5, highlightSeriesBackgroundAlpha = 0.2, hideOnMouseOut = FALSE) %>%
dyRoller(rollPeriod = 1)
Search the gallery