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