Learn R Programming

geosphere (version 1.0.0)

daylength: date routines

Description

Compute daylength for a latitude and date.

Usage

daylength(lat, doy)

Arguments

lat
latitude, in degrees. I.e. between -90.0 and 90.0
doy
Interger, day of the year (1..365) or (1:366) for leap years; or an object of class Date, or a characterr Date or character like as 'yyyy-mm-dd', e.g. '1982-11-23'

Value

  • Daylength in hours

References

Forsythe, William C., Edward J. Rykiel Jr., Randal S. Stahl, Hsin-i Wu and Robert M. Schoolfield, 1995. A model comparison for daylength as a function of latitude and day of the year. Ecological Modeling 80:87-95.

Examples

Run this code
daylength(-25, '2010-10-10')
daylength(45, 1:365)

Run the code above in your browser using DataLab