Create a Vector of All Days Between Two Dates

You’re looking for seq > seq(as.Date(“2011-12-30”), as.Date(“2012-01-04″), by=”days”) [1] “2011-12-30” “2011-12-31” “2012-01-01” “2012-01-02” “2012-01-03” [6] “2012-01-04” Or, you can use : > as.Date(as.Date(“2011-12-30”):as.Date(“2012-01-04″), origin=”1970-01-01”) [1] “2011-12-30” “2011-12-31” “2012-01-01” “2012-01-02” “2012-01-03” [6] “2012-01-04″ Note that with : “Non-numeric arguments are coerced internally”. Thus, we convert back to class Date, using as.Date method for class ‘numeric’ and … Read more

R sequence of dates with lubridate

ymd is a wrapper to parse date strings and returns a POSIXct object. You simply need to use standard terminology described in ?seq.POSIXt (not lubridate) to define weeks seq(ymd(‘2012-04-07’),ymd(‘2013-03-22’), by = ‘1 week’) seq(ymd(‘2012-04-07’),ymd(‘2013-03-22’), by = ‘weeks’) will works as will seq(ymd(‘2012-04-07’),ymd(‘2013-03-22’), by = ‘2 week’) You could coerce the lubridate Period class object to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)