-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
65 lines (49 loc) · 1.88 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
output: github_document
---
<!--
README.md is generated from README.Rmd. Please edit that file
rmarkdown::render("README.Rmd")
-->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "tools/README-"
)
```
<!-- badges: start -->
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/solartime)](http://cran.r-project.org/package=solartime)
[![R-CMD-check](https://github.com/bgctw/solartime/workflows/R-CMD-check/badge.svg)](https://github.com/bgctw/solartime/actions)
[![R-CMD-check](https://github.com/bgctw/solartime/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/bgctw/solartime/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
## Overview
The `solartime` package provides utilities to work with solar time,
i.e. where noon is exactly when sun culminates.
It provides functions to compute
- difference between local time zone and solar time
- sun position
- sunrise, sunset, daylength, and daytime flags
## Installation
```{r, eval = FALSE}
# From CRAN (in future)
#install.packages("solartime")
# Or the the development version from GitHub:
# install.packages("devtools")
devtools::install_github("bgctw/solartime")
```
## Usage
The city of Jena is located west of the timezone's meridian.
Hence, the sun culminates around 13 minutes later.
The time difference shifts during the year because of
[earth orbit's eccentricity](https://en.wikipedia.org/wiki/Orbital_eccentricity).
```{r eccentricityPlot}
require(solartime, quietly = TRUE)
latDeg <- 50.93; longDeg <- 11.57
doy <- 1:366
locaDiffMin <- 60 * computeSolarToLocalTimeDifference(
longDeg, timeZone = 1L, doy = doy)
plot(locaDiffMin ~ doy, ylab = "time difference solar - local time (min)")
abline(h = localDiff); abline(h = 0, lty = "dotted")
```
See the [package vignettes](https://github.com/bgctw/solartime/tree/master/vignettes) (*.md) for further examples.