R package to calculate tide heights
R
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
R
data-raw
data
docs
man
revdep
tests
tools
.Rbuildignore
.gitignore
.travis.yml
CONDUCT.md
DESCRIPTION
NAMESPACE
NEWS.md
README.Rmd
README.md
appveyor.yml
codemeta.json
cran-comments.md
document.R
rtide.Rproj

README.md

lifecycle Travis-CI Build Status AppVeyor Build status codecov CRAN_Status_Badge CRAN Downloads

rtide

Introduction

rtide is an R package to calculate tide heights based on tide station harmonics.

It includes the harmonics data for 637 US stations.

Utilisation

library(rtide)
#> rtide is not suitable for navigation

data <- rtide::tide_height(
  "Monterey Harbor", from = as.Date("2016-07-13"), to = as.Date("2016-07-15"), 
  minutes = 10L, tz = "PST8PDT")

print(head(data))
#> # A tibble: 6 x 3
#>   Station                               DateTime            TideHeight
#>   <chr>                                 <dttm>                   <dbl>
#> 1 Monterey, Monterey Harbor, California 2016-07-13 00:00:00      0.514
#> 2 Monterey, Monterey Harbor, California 2016-07-13 00:10:00      0.496
#> 3 Monterey, Monterey Harbor, California 2016-07-13 00:20:00      0.481
#> 4 Monterey, Monterey Harbor, California 2016-07-13 00:30:00      0.468
#> 5 Monterey, Monterey Harbor, California 2016-07-13 00:40:00      0.457
#> 6 Monterey, Monterey Harbor, California 2016-07-13 00:50:00      0.449
library(ggplot2)
library(scales)
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 release version from CRAN

install.packages("rtide")

Or the development version from GitHub

# install.packages("devtools")
devtools::install_github("poissonconsulting/rtide")

Citation


To cite package 'rtide' in publications use:

  Joe Thorley, Luke Miller and Abram Fleishman (2018). rtide: Tide
  Heights. R package version 0.0.4.9010.
  https://github.com/poissonconsulting/rtide

A BibTeX entry for LaTeX users is

  @Manual{,
    title = {rtide: Tide Heights},
    author = {Joe Thorley and Luke Miller and Abram Fleishman},
    year = {2018},
    note = {R package version 0.0.4.9010},
    url = {https://github.com/poissonconsulting/rtide},
  }

Contribution

Please report any issues.

Pull requests are always welcome.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Inspiration

The harmonics data was converted from harmonics-dwf-20151227-free, NOAA web site data processed by David Flater for XTide. The code to calculate tide heights from the harmonics is based on XTide.