getSunlightPosition: Get Sunlight position

Description Usage Arguments Details Value See Also Examples

View source: R/getSunlightPosition.R

Description

Get Sunlight position

Usage

1
2
getSunlightPosition(date = NULL, lat = NULL, lon = NULL,
  data = NULL, keep = c("altitude", "azimuth"))

Arguments

date

: Single or multiple DateTime. Can be a Date (YYYY-MM-DD), a character in UTC (YYYY-MM-DD HH:mm:ss) or a POSIXct

lat

: numeric. Single latitude

lon

: numeric. Single longitude

data

: data.frame. Alternative to use date, lat, lon for passing multiple coordinates

keep

: character. Vector of variables to keep. See Details

Details

Returns an object with the following properties:

Value

data.frame

See Also

getSunlightTimes, getMoonTimes, getMoonIllumination, getMoonPosition,getSunlightPosition

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 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"))

      

suncalc documentation built on May 2, 2019, 7:33 a.m.