title: Convert natural year to hydrological year time series Rasterbrick R
body: <p>Given a <code>rasterbrick</code> with natural years (<code>Jan-Dec</code>), how can one convert it to have hydrological years (starting on the <code>1st October and ending on the following 30th September</code>)? Something similar (but not exact) to the question <a href="https://stackoverflow.com/questions/22073881/hydrological-year-time-series">here</a>.</p>
  
  <p><strong>Sample data:</strong></p>
  
  <pre><code>     nl &lt;- 768
       s &lt;- brick(nrows = 510,  ncols = 1068,
                     xmn = -180, xmx = 180, ymn = -90, ymx = 90,
                     crs = "+proj=longlat +datum=WGS84",
                     nl = nl,values=TRUE)
          dates &lt;- seq(as.Date("1950-01-01"), as.Date("2013-12-31"), by = "month")
          s &lt;- setZ(s, dates)
  vals &lt;- 1:ncell(s)
  s[]=vals
  </code></pre>