# NOT RUN {
# new DTSg object
x <- DTSg$new(values = flow)
# subset the first two years
## R6 method
x$alter(from = "2007-01-01", to = "2008-12-31")
## S3 method
alter(x = x, from = "2007-01-01", to = "2008-12-31")
# change periodicity to one month
## R6 method
x$alter(by = "1 month")
## S3 method
alter(x = x, by = "1 month")
# }
Run the code above in your browser using DataLab