Skip to content
Prev 164628 / 398506 Next

loop with dates

See ?"for". That help page mentions the following which can clarify what
to expect 

"... The variable 'var' has the same type as 'seq' ..."

Small illustration,

fac  <- gl(5,1,labels=letters[1:5])
fac
[1] a b c d e
Levels: a b c d e

typeof(fac)
[1] "integer"

for(i in fac) print(i)
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
typeof(ffin)
[1] "double"

As your index is no longer of class 'Date', you will get
Error in UseMethod("weekdays") : no applicable method for "weekdays
Here's one way 
dd <- seq(fini,to = ffin, by='days')
for (i in seq_along(dd)) print(dd[i])