[R] daylight

Mark Dalphin mark.dalphin at pacificedge.co.nz
Wed Oct 24 02:25:41 CEST 2012


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:
> hi there,
> does anyone know how to calculate the amount of daylight on every day of the
> year in R? I mean the time between sunrise and sunset.
>
> thanks
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/daylight-tp4647213.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>   

-- 
	


    Mark Dalphin Ph.D.

Director of Bioinformatics

mark.dalphin at pacificedge.co.nz <mailto:mark.dalphin at pacificedge.co.nz>
*Ph:* +64-3-479-5805
*Cell:* +64-21-156-7625
*Skype:* mark.dalphin.pel
<http://www.facebook.com/pages/Pacific-Edge/111356775582456> 
<http://twitter.com/#%21/pacificEdgeLtd> 
<http://www.youtube.com/PacificEdgeLtd>

87 St David St, PO Box 56, Dunedin, New Zealand 9016www.pacificedge.co.nz



More information about the R-help mailing list