create_suntimes_df: Create a data frame of sunrises and sunsets

View source: R/create-suntimes.R

create_suntimes_dfR Documentation

Create a data frame of sunrises and sunsets

Description

Generate a data frame that specifies sunrises and sunsets for different coordinates and dates. The package suncalc is required to use this function.

Usage

create_suntimes_df(coords, dates, tz = Sys.timezone(), .quiet = FALSE)

Arguments

coords

Data frame with the fields station, lat and lon. Defines the latitude and longitude for the respective stations.

dates

Dates that should be processed.

tz

Timezone of the results.

.quiet

If TRUE, messages are suppressed.

Value

A data frame with the columns date, station and sunrise and sunset. The values of sunrise and sunset indicate the respective time in minutes.

See Also

create_suntimes_rsts()

Examples



date_start <- as.Date('2020-01-01')
date_end <- as.Date('2020-12-31')

st <- create_suntimes_df(barrks_data('station_coords'),
                         seq(date_start, date_end, by = 'day'),
                         .quiet = TRUE)

# print results of station 'Freiburg'
st[st$station == 'Freiburg',]



barrks documentation built on April 3, 2025, 9:47 p.m.