mco_get_gridmet: Download select GridMET datasets.

View source: R/mco_get_gridmet.R

mco_get_gridmetR Documentation

Download select GridMET datasets.

Description

Download select GridMET datasets.

Usage

mco_get_gridmet(
  x = mt_state %>% sf::st_buffer(10000),
  elements = c("precipitation_amount", "daily_minimum_temperature",
    "daily_maximum_temperature"),
  dates = "latest",
  out_dir = tempdir(),
  overwrite = TRUE,
  ...
)

Arguments

x

An object of class sf.

elements

Gridmet variables to download.

dates

An object of class Date or a character string formatted as %Y-%m-%d (e.g., "2016-04-01") which specifies the date(s) to search. To search for one specific date, this can be a Date object of length one. To return data over a time interval, it can be a vector of length 2 (e.g., c("2018-01-01","2018-03-31")). Use "latest" (the default) to retreive the most recent date available product.

out_dir

A directory in which to download the raw MACA V2 datasets. Defaults to the current working directory

overwrite

Whether to overwrite a file in the out_dir of the same element.

...

Other parameters passed on to thredds::tds_ncss_download.

Value

A raster brick of the desired MACA V2 datasets.

Examples

## Not run: 
test <- mco_get_gridmet()
test <- mco_get_gridmet(dates = "2018-02-14")
test <- mco_get_gridmet(dates = "2018-03-31")
test <- mco_get_gridmet(dates = c("2018-01-01","2018-04-01"))

## End(Not run)

mt-climate-office/mcor documentation built on March 27, 2024, 6:30 p.m.