-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.Rmd
95 lines (70 loc) · 2.96 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-"
)
```
# rtide <img src="man/figures/logo.png" align="right" />
<!-- badges: start -->
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![R-CMD-check](https://github.com/poissonconsulting/rtide/workflows/R-CMD-check/badge.svg)](https://github.com/poissonconsulting/rtide/actions)
[![Codecov test coverage](https://codecov.io/gh/poissonconsulting/rtide/branch/master/graph/badge.svg)](https://codecov.io/gh/poissonconsulting/rtide?branch=master)
[![License: GPL3](https://img.shields.io/badge/License-GPL3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)
[![CRAN status](https://www.r-pkg.org/badges/version/rtide)](https://cran.r-project.org/package=rtide)
![CRAN downloads](https://cranlogs.r-pkg.org/badges/rtide)
<!-- badges: end -->
## Introduction
`rtide` is an R package to calculate tide heights based on tide station harmonics.
It includes the harmonics data for `r length(rtide::tide_stations())` US stations.
## Utilisation
```{r}
library(tibble)
library(rtide)
data <- rtide::tide_height(
"Monterey Harbor",
from = as.Date("2016-07-13"), to = as.Date("2016-07-15"),
minutes = 10L, tz = "PST8PDT"
)
print(data)
```
```{r, message=FALSE}
library(ggplot2)
library(scales)
```
```{r}
ggplot(data = data, aes(x = DateTime, y = TideHeight)) +
geom_line() +
scale_x_datetime(
name = "Date",
labels = date_format("%d %b %Y", tz = "PST8PDT")
) +
scale_y_continuous(name = "Tide Height (m)") +
ggtitle("Monterey Harbour")
```
## Installation
To install the latest release from [CRAN](https://cran.r-project.org)
```{r, eval=FALSE}
install.packages("rtide")
```
To install the developmental version from [GitHub](https://github.com/poissonconsulting/rtide)
```{r, eval=FALSE}
# install.packages("remotes")
remotes::install_github("poissonconsulting/rtide")
```
## Shiny
Tide heights can be also obtained using rtide through a [shiny interface](https://poissonconsulting.shinyapps.io/rtide/) developed by Seb Dalgarno.
## Contribution
Please report any [issues](https://github.com/poissonconsulting/rtide/issues).
[Pull requests](https://github.com/poissonconsulting/rtide/pulls) are always welcome.
## Code of Conduct
Please note that the rtide project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html).
By contributing to this project, you agree to abide by its terms.
## Inspiration
The harmonics data was converted from <https://github.com/poissonconsulting/rtide/blob/master/data-raw/harmonics-dwf-20151227-free.tar.bz2>, NOAA web site data
processed by David Flater for [`XTide`](https://flaterco.com/xtide/).
The code to calculate tide heights from the harmonics is based on `XTide`.