View source: R/getSunlightTimes.R
| getSunlightTimes | R Documentation |
Get Sunlight times
getSunlightTimes(
date = NULL,
lat = NULL,
lon = NULL,
data = NULL,
keep = c("solarNoon", "nadir", "sunrise", "sunset", "sunriseEnd", "sunsetStart",
"dawn", "dusk", "nauticalDawn", "nauticalDusk", "nightEnd", "night", "goldenHourEnd",
"goldenHour"),
tz = "UTC"
)
date |
|
lat |
|
lon |
|
data |
|
keep |
|
tz |
|
Available variables are :
sunrise (top edge of the sun appears on the horizon)
sunrise ends (bottom edge of the sun touches the horizon)
morning golden hour (soft light, best time for photography) ends
solar noon (sun is in the highest position)
evening golden hour starts
sunset starts (bottom edge of the sun touches the horizon)
sunset (sun disappears below the horizon, evening civil twilight starts)
dusk (evening nautical twilight starts)
nautical dusk (evening astronomical twilight starts)
night starts (dark enough for astronomical observations)
nadir (darkest moment of the night, sun is in the lowest position)
night ends (morning astronomical twilight starts)
nautical dawn (morning nautical twilight starts)
dawn (morning nautical twilight ends, morning civil twilight starts)
data.frame
Other suncalc functions:
getMoonIllumination(),
getMoonPosition(),
getMoonTimes(),
getSunlightPosition()
# one date
getSunlightTimes(date = Sys.Date(), lat = 50.1, lon = 1.83, tz = "CET")
# multiple date + subset
getSunlightTimes(date = seq.Date(Sys.Date()-9, Sys.Date(), by = 1),
keep = c("sunrise", "sunriseEnd", "sunset", "sunsetStart"),
lat = 50.1, lon = 1.83, tz = "CET")
# multiple coordinates
data <- data.frame(date = seq.Date(Sys.Date()-9, Sys.Date(), by = 1),
lat = c(rep(50.1, 10), rep(49, 10)),
lon = c(rep(1.83, 10), rep(2, 10)))
getSunlightTimes(data = data,
keep = c("sunrise", "sunriseEnd", "sunset", "sunsetStart"), tz = "CET")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.