getSunlightTimes {suncalc}R Documentation

Get Sunlight times

Description

Get Sunlight times

Usage

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"
)

Arguments

date

: Date. Single or multiple Date. YYYY-MM-DD

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

tz

: character. Timezone of results

Details

Available variables are :

Value

data.frame

See Also

getSunlightTimes, getMoonTimes, getMoonIllumination, getMoonPosition,getSunlightPosition

Examples


# 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")
      

[Package suncalc version 0.5.1 Index]