title: Have Dygraph.WEEKLY labeling use Mondays as ticks in R
body: <p>I'm graphing weekly data using the <a href="https://cran.r-project.org/package=dygraphs" rel="nofollow noreferrer"><code>dygraphs</code></a> package. <code>dygraphs</code> automatically selects a weekly default axis. However, I'm hoping there is a way to have the default axis (Sundays) line up with my data (Mondays).</p>
  
  <pre><code># Required packages
  library("magrittr")
  library("dygraphs")
  library("xts")
  
  # Data
  daily &lt;- structure(c(4000, 5000, 3000, 7000, 2000, 5000, 7000, 
                     2000, 3000, 6000, 5000, 9000, 2000, 2000, 2000, 
                     7000, 9000, 2000, 1000, 13000), .Dim = c(10L, 2L), .Dimnames = list(
                       NULL, c("col1", "col2")), index = structure(c(1476032400, 
                                                                     1476637200, 1477242000, 1477846800, 1478451600, 1479056400, 1479661200, 
                                                                     1480266000, 1480870800, 1481475600), tzone = "Asia/Saigon", tclass = c("POSIXct", 
                                                                                                                                            "POSIXt")), class = c("xts", "zoo"), .indexCLASS = c("POSIXct", 
                                                                                                                                                                                                 "POSIXt"), tclass = c("POSIXct", "POSIXt"), .indexTZ = "Asia/Saigon", tzone = "Asia/Saigon")
  
  # Graph
  dygraph(daily, main = "Stackoverflow") %&gt;%
    dyRangeSelector() %&gt;%
    dyOptions(useDataTimezone = TRUE) 
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/aJjuj.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aJjuj.jpg" alt="dygraph render"></a></p>