getMoonTimes: Get Moon times

View source: R/getMoonTimes.R

getMoonTimesR Documentation

Get Moon times

Description

Get Moon times

Usage

getMoonTimes(
  date = NULL,
  lat = NULL,
  lon = NULL,
  data = NULL,
  keep = c("rise", "set", "alwaysUp", "alwaysDown"),
  tz = "UTC",
  inUTC = FALSE
)

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

inUTC

: logical. By default, it will search for moon rise and set during local user's day (from 0 to 24 hours). If TRUE, it will instead search the specified date from 0 to 24 UTC hours.

Details

Available variables are :

  • "rise" : Date. moonrise time

  • "set" : Date. moonset time

  • "alwaysUp" : Logical. TRUE if the moon never rises or sets and is always above the horizon during the day

  • "alwaysDown" : Logical. TRUE if the moon is always below the horizon

Value

data.frame

See Also

getSunlightTimes, getMoonTimes, getMoonIllumination, getMoonPosition,getSunlightPosition

Examples


# one date
getMoonTimes(date = Sys.Date(), lat = 47.21, lon = -1.557, tz = "CET")

# multiple date + subset
getMoonTimes(date = seq.Date(Sys.Date()-9, Sys.Date(), by = 1), 
  keep = c("rise", "set", "alwaysUp"), 
  lat = 47.21, lon = -1.557, 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)))
    
getMoonTimes(data = data, tz = "CET")
      

suncalc documentation built on Sept. 29, 2022, 5:11 p.m.