Re: [R] fridays date to date

2012-03-02 Thread Greg Snow
If you know that your first date is a Friday then you can use seq with by=7 day, then you don't need to post filter the vector. On Thu, Mar 1, 2012 at 1:40 PM, Ben quant ccqu...@gmail.com wrote: Great thanks! ben On Thu, Mar 1, 2012 at 1:30 PM, Marc Schwartz marc_schwa...@me.com wrote: On

[R] fridays date to date

2012-03-01 Thread Ben quant
Hello, How do I get the dates of all Fridays between two dates? thanks, Ben [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] fridays date to date

2012-03-01 Thread R. Michael Weylandt
Inelegant, but here's one way: d1 - Sys.Date() d2 - Sys.Date() + 100 library(lubridate) d - seq(d1, d2, by = day) d[wday(d)==6] Michael On Thu, Mar 1, 2012 at 3:02 PM, Ben quant ccqu...@gmail.com wrote: Hello, How do I get the dates of all Fridays between two dates? thanks, Ben      

Re: [R] fridays date to date

2012-03-01 Thread Marc Schwartz
On Mar 1, 2012, at 2:02 PM, Ben quant wrote: Hello, How do I get the dates of all Fridays between two dates? thanks, Ben Days - seq(from = as.Date(2012-03-01), to = as.Date(2012-07-31), by = day) str(Days) Date[1:153], format: 2012-03-01 2012-03-02

Re: [R] fridays date to date

2012-03-01 Thread Ben quant
Great thanks! ben On Thu, Mar 1, 2012 at 1:30 PM, Marc Schwartz marc_schwa...@me.com wrote: On Mar 1, 2012, at 2:02 PM, Ben quant wrote: Hello, How do I get the dates of all Fridays between two dates? thanks, Ben Days - seq(from = as.Date(2012-03-01), to =