I am trying to run a for loop that loops through a vector of dates. However, the behavior is very strange.:
library(lubridate)
dates<-ymd(c("2014-12-26","2014-12-19"))
for (run_date in dates) { print(run_date)}
As you can see, the dates object looks like the following:
> dates
[1] "2014-12-26 UTC" "2014-12-19 UTC"
However, what is stored in the run_date variable is the following:
> for (run_date in dates) { print(run_date)}
[1] 1419552000
[1] 1418947200
Strange behavior and not quite sure what the issue is. Does anyone have any thoughts?