knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

buoydata

gh-pages R-CMD-check gitleaks Hits

The goal of buoydata is to easily download and process buoy data hosted by National Data Buoy Center.

Note: the rnoaa package also has functions to get buoy data. The difference is that (in rnoaa) only one years worth of data can be downloaded at any time from a single buoy. As of 2023 rnoaa is no longer officially supported

buoydata downloads multiple years and stitches all years data together in a single data frame. In addition the lazily loaded station description data provided with the package combines many more attributes (than rnoaa) by which to filter.

Date of most recent data pull: r strsplit(as.character(file.info(here::here("data-raw","datapull.txt"))$mtime)," ")[[1]][1]

Installation

remotes::install_github("NOAA-EDAB/buoydata")

Example

Find all buoys located between latitude [41,43] and longitude [-71,-67] with a time series of at least 20 years. Then pull and process data from a single buoy.

``` {r, eval=T} library(buoydata)

buoydata::buoyDataWorld |> dplyr::filter(LAT > 41,LAT < 43) |> dplyr::filter(LON > -71, LON < -69) |> dplyr::filter(nYEARS >= 20)

``` r
# get the data for buoy 44013
get_buoy_data(buoyid="44013",year=1984:2019,outDir=here::here("output"))

# process sea surface temperature (celcius) into one large data frame
data <- combine_buoy_data(buoyid = "44013",variable="WTMP",inDir = here::here("output"))

Then plot the data

 ggplot2::ggplot(data) +
   ggplot2::geom_line(ggplot2::aes(x=DATE,y=WTMP)) + 
   ggplot2::ylab("Sea Surface Temp (Celcius)") +
   ggplot2::xlab("")

Reference

Documentation of the meteorological data can be found on the National Data Buoy Center website

Contact

| andybeet
| ----------------------------------------------------------------------------------------------- | |

Legal disclaimer

This repository is a scientific product and is not official communication of the National Oceanic and Atmospheric Administration, or the United States Department of Commerce. All NOAA GitHub project code is provided on an ‘as is’ basis and the user assumes responsibility for its use. Any claims against the Department of Commerce or Department of Commerce bureaus stemming from the use of this GitHub project will be governed by all applicable Federal law. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by the Department of Commerce. The Department of Commerce seal and logo, or the seal and logo of a DOC bureau, shall not be used in any manner to imply endorsement of any commercial product or activity by DOC or the United States Government.



andybeet/ndbcbuoy documentation built on Dec. 28, 2024, 10:51 a.m.