cpcQueryDateRange: Access CPC Data for a Short Date Range

Description Usage Arguments Value

View source: R/cpcQueryDateRange.R

Description

This function provides access to CPC data for a date range. This function is intended to be called directly. For each date in the date range, it downloads the raw files, reads them to an array, and deletes the raw files. By default it returns a tidy data.table, but it can also return a 3D array.

Usage

1
cpcQueryDateRange(start_date, end_date, tidy = TRUE)

Arguments

start_date

the first data to download. Must be a date object – see lubridate package for easy creation of date objects with the lubridate::ymd() function.

end_date

as with start_date, must be a date object.

tidy

if TRUE, the output data will be a tidy data.table with columns lon, lat, and prcp_mm. if FALSE, the output data will be a 3D array with indices [lon, lat, time]

Value

returns a list with two entries: download_success and precip_data. download_success is a data.frame with columns date and success, which define whether data was successfully downloaded for each date in the range seq(start_date, end_date, 1). precip_data is a 3D array if tidy is FALSE and a data.table if tidy is TRUE.


jdossgollin/cpcRain documentation built on May 18, 2019, 11:33 p.m.