View source: R/getSunlightPosition.R
| getSunlightPosition | R Documentation |
Get Sunlight position
getSunlightPosition(
date = NULL,
lat = NULL,
lon = NULL,
data = NULL,
keep = c("altitude", "azimuth")
)
date |
Single or multiple DateTime. Can be a |
lat |
|
lon |
|
data |
|
keep |
|
Returns an object with the following properties:
sun altitude above the horizon in radians, e.g. 0 at the horizon and PI/2 at the zenith (straight over your head)
sun azimuth in radians (direction along the horizon, measured from south to west), e.g. 0 is south and Math.PI * 3/4 is northwest
data.frame
Other suncalc functions:
getMoonIllumination(),
getMoonPosition(),
getMoonTimes(),
getSunlightTimes()
# one date
getSunlightPosition(date = Sys.Date(), lat = 50.1, lon = 1.83)
# in character
getSunlightPosition(date = c("2017-05-12", "2017-05-12 00:00:00"),
lat = 50.1, lon = 1.83)
# in POSIXct
getSunlightPosition(date = as.POSIXct("2017-05-12 00:00:00", tz = "UTC"),
lat = 50.1, lon = 1.83)
getSunlightPosition(date = as.POSIXct("2017-05-12 02:00:00", tz = "CET"),
lat = 50.1, lon = 1.83)
# multiple date + subset
getSunlightPosition(date = seq.Date(Sys.Date()-9, Sys.Date(), by = 1),
keep = c("altitude"),
lat = 50.1, lon = 1.83)
# 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)))
getSunlightPosition(data = data,
keep = c("altitude", "azimuth"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.