sunsetter2.Rd
Calculate the sunrise and sunset times for a given set of date and location combinations
sunsetter2(df, dates, lat, lng)
dataframe containing the dates, latitudes, longitudes, sunrise time and sunset time.
This function uses the sunrise-sunset API to calculate the sunrise and sunset times for a given set of date and location combinations.
Other temporal:
sunsetter()
if (FALSE) { # \dontrun{
# create a dataframe with dates, latitudes and longitudes
df <- data.frame(dates = c("2021-01-01", "2021-01-01", "2020-12-25"),
location = c("Brussels", "Amsterdam", "Brussels"),
lat = c(50.866572, 52.367573, 50.866572),
lng = c(4.350309, 4.904138, 4.350309),
remarks = c("New Year's Day", "New Year's Day", "Christmas Day"))
# calculate the sunrise and sunset times for the dataframe
sunsets <- sunsetter2(df)
# add the sunrise and sunset times to the dataframe
df <- dplyr::bind_cols(df, sunsets %>% dplyr::select(-dates))
df
} # }