
get_daynight_times
get_daynight_times.Rd
This function calculates time since sunrise, time since sunset, and day and
night hours for points in an sf
object. The function also optionally saves
the output as an RDS file.
Usage
get_daynight_times(
points,
time_column_name = NULL,
save = FALSE,
savepath = "./output/extracted_day_night_stats.rds",
units = "hours"
)
Arguments
- points
An
sf
object containing geometry and a time_column with datetime as alubridate::interval
.- time_column_name
Name of the time column in the dataset. If NULL (the default), a column of type lubridate::interval is automatically selected.
- save
A logical value indicating whether to save the extracted day and night time information as an RDS file. Default is
FALSE
.- savepath
The path to save the RDS file, defaults to './output/extracted_day_night_stats.rds'.
- units
A string specifying the units of time to return, defaults to 'hours'.