Skip to contents

This function calculates the time elapsed since sunset given a specific location and time.

Usage

get_time_since_sunset(start, lat, lon, units = "hours")

Arguments

start

A POSIXct object representing the start time.

lat

The latitude of the location.

lon

The longitude of the location.

units

A string representing the units in which to output the time, defaults to 'hours'.

Value

A numeric representing the time elapsed since sunset.

Examples

if (FALSE) { # \dontrun{
time_since_sunset <- get_time_since_sunset(
  start = Sys.time(),
  lat = 51.5074,
  lon = 0.1278,
  units = 'minutes'
)
} # }