Learn R Programming

HelpersMG (version 5.1)

sun.info: Estimate the time of sunrise and sunset according to longitude, latitude and date

Description

Estimate the sun fates according to latitude and date. Can be compared with the function sunrise.set() of package StreamMetabolism.

Usage

sun.info(date, latitude, longitude)

Arguments

date

A vector with the time at which sun fates are needed

latitude

The latitude at which estimate the sun fates

longitude

The longitude at which estimate the sun fates

Value

A data.frame with information about daily sun

Details

sun.info estimate the time of sunrise and sunset according to longitude, latitude and date

References

Teets, D.A. 2003. Predicting sunrise and sunset times. The College Mathematics Journal 34(4):317-321.

See Also

Other Periodic patterns of indices: index.periodic(), minmax.periodic(), moon.info(), tide.info()

Examples

Run this code
# NOT RUN {
# Generate a timeserie of time
date <- seq(from=as.Date("2000-01-01"), to=as.Date("2000-12-31"), by="1 day")
plot(date, sun.info(date, latitude=23, longitude=0)$day.length, bty="n", 
 las=1, type="l", xlab="Ordinal days", ylab="Day length in hours")
plot(date, sun.info(date, latitude=23, longitude=0)$sunrise, bty="n", 
 las=1, type="l", xlab="Ordinal days", ylab="Sun rise in hours")
# }

Run the code above in your browser using DataLab