Skip to content

dankelley/dod

Repository files navigation

dod

CRAN status R-CMD-check

The goal of dod is to make it easier to download various types of oceanographic data from common sources such as BATS, NOAA, MEDS, BBMP. Some similar functions exist in the oce package, but the intention is to retire them as dod matures, because building oce is difficult for some users, and CRAN policies dictate against frequent updates.

Installation

You can install the development version of dod from GitHub with:

# install.packages("devtools")
devtools::install_github("dankelley/dod")

Example

The following example shows how to (1) download an index of ctd data files resulting from observations made as part of the BBMP program in the present year and then (2) use functions in the oce package to read and plot the last observations in the dataset.

library(dod)
# 1. Get index
library(dod)
year <- format(Sys.Date(), "%Y")
indexFile <- dod.ctd("BBMP", year, index = TRUE)
index <- read.csv(indexFile, header = TRUE, skip = 2)
# see first few lines to discover column names
head(index, 3)
#>            FILE     START_DATE_TIME
#> 1 D24667001.ODF 2024-01-03 13:01:41
#> 2 D24667002.ODF 2024-01-09 13:10:48
#> 3 D24667003.ODF 2024-01-17 12:55:39
# 2. Get the most recent file and plot the data
item <- tail(index, 1)$FILE
file <- dod.ctd("BBMP", year, item)
library(oce)
#> Loading required package: gsw
d <- read.ctd(file)
# 3. Standard CTD plot
plot(d)

# 4. Check also biochemistry variables
par(mfrow = c(2, 2))
plotProfile(d, "SA")
plotProfile(d, "CT")
plotProfile(d, "oxygen")
plotProfile(d, "fluorescence")

PS. This README.md file was created on 2024-04-02 by rendering the README.Rmd file with devtools::build_readme().

About

Download Oceanographic Data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published