create_daylength_df {barrks} | R Documentation |
Create a data frame of day lengths
Description
Generate a data frame of day lengths for given latitudes.
The package geosphere
is required to use this function.
Usage
create_daylength_df(lat, dates, .quiet = FALSE)
Arguments
lat |
Data frame with the fields |
dates |
Dates that should be processed. |
.quiet |
If |
Value
A data frame with the columns date
, station
and daylength
.
See Also
Examples
# dates of interest
date_start <- as.Date('2020-01-01')
date_end <- as.Date('2020-12-31')
# calculate day length
dl <- create_daylength_df(barrks_data('station_coords'),
seq(date_start, date_end, by = 'day'),
.quiet = TRUE)
# print day lengths of station 'Freiburg'
dl[dl$station == 'Freiburg',]
[Package barrks version 1.1.1 Index]