| shiftyears | R Documentation |
It shifts years backwards for correct computation of annual values when the hydrological year does not start in january. Originally created only for internal usage in this pacakge.
shiftyears(ltime, lstart.month)
ltime |
vector with the date/times of each element of a zoo object. |
lstart.month |
numeric in [1,..,12], representing the starting month to be used in the computation of annual values. By default |
Integer vector with the shifted years corresponding to each elemen of x.
Mauricio Zambrano-Bigiarini, mzb.devel@gmail
climograph, cmv, daily2annual
# Loading the DAILY precipitation data at SanMartino
data(SanMartinoPPts)
x <- SanMartinoPPts
# Subsetting 'x' to its first three months (Jan/1921 - Mar/1921)
x <- window(x, end="1921-12-31")
# Starting in January, it means no shift
shiftyears(ltime=time(x), lstart.month=1)
# Starting in April:
shiftyears(ltime=time(x), lstart.month=4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.