If I have a sequence of dates then how can I select a subset of this
sequence? For example suppose, I have following sequence of dates:

dat_seq <- seq(as.Date("2000-01-01"), as.Date("2010-01-01"), by="1 day")

Now I want to select all dates of above sequence (this sequence may not be
continuous like above!) from "as.Date("2007-01-01")" to
"as.Date("2007-12-01"))", how can I achieve that? I have tried following
without any success:

> dat_seq <- seq(as.Date("2000-01-01"), as.Date("2010-01-01"), by="1
day")
> window(dat_seq, start = as.Date("2007-01-01"), end =
as.Date("2007-12-01"))
Error in window.default(dat_seq, start = as.Date("2007-01-01"), end =
as.Date("2007-12-01")) :
  'start' cannot be after 'end'
In addition: Warning message:
In window.default(dat_seq, start = as.Date("2007-01-01"), end =
as.Date("2007-12-01")) :
  'end' value not changed
Your help will be highly appreciated.

Thanks

        [[alternative HTML version deleted]]

_______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should 
go.

Reply via email to