OISST_sub_dl: Download NOAA OISST Data

Description Usage Arguments Value Examples

View source: R/OISST_sub_dl.r

Description

Download NOAA OISST Data

Usage

1
2
3
4
5
6
7
8
OISST_sub_dl(
  start,
  end,
  latitude_ext,
  longitude_ext,
  url = "https://coastwatch.pfeg.noaa.gov/erddap/",
  dataset = "ncdcOisst21Agg_LonPM180"
)

Arguments

start

Start date. Must be formatted with as.Date()

end

End date. Must be formatted with as.Date()

latitude_ext

Vector of two coordinates with latitude extent.

longitude_ext

Vector of two coordinates with longitude extent

url

URL of ERDDAP server. Defaults to https://coastwatch.pfeg.noaa.gov/erddap

dataset

Dataset used on ERDDAP server. Defaults to ncdcOisst21Agg_LonPM180 See https://coastwatch.pfeg.noaa.gov/erddap/search/index.html?page=1&itemsPerPage=1000&searchFor=OISST for more.

Value

A data frame of latitude, longitude, date, and temperature

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
library(ggplot2)

temp <- OISST_sub_dl(
  start = as.Date("1982-01-01"),
  end = as.Date("1989-12-31"),
  latitude_ext = c(-40, -35),
  longitude_ext = c(15, 21)
)

  ggplot(data = temp,
    aes(x = lon, y = lat)) +
    geom_tile(aes(fill = temp)) +
    scale_fill_viridis_c() +
    coord_quickmap(expand = F) +
    labs(x = NULL, y = NULL, fill = "SST (°C)") +
    theme(legend.position = "bottom")

## End(Not run)

jebyrnes/oisstr documentation built on Dec. 20, 2021, 10:08 p.m.