Skip to content
Prev 308857 / 398503 Next

daylight

I would start with the data. My source for this is the US Navy 
Sunrise/Sunset tables:
    http://aa.usno.navy.mil/data/docs/RS_OneYear.php

The page is produces is pure text; I've previously extracted the values 
with a simple Perl script, but would do it today using R (in general, 
most of the parsing I used to perform in Perl can readily be performed 
in R).

Once I had the data available as a data frame, I'd convert the columns 
to POSIXct format and then use difftime().

Cheers,
Mark
bambus wrote: