wrcc_downloadData: Download RAWS data

View source: R/wrcc_downloadData.R

wrcc_downloadDataR Documentation

Download RAWS data

Description

Request data from a particular station for the desired time period. Data are returned as a single character string containing the RAWS output.

Station identifiers can be found at https://raws.dri.edu/.

Usage

wrcc_downloadData(
  wrccID = NULL,
  startdate = strftime(lubridate::now(tzone = "UTC"), "%Y%m0101", tz = "UTC"),
  enddate = strftime(lubridate::now(tzone = "UTC"), "%Y%m%d23", tz = "UTC"),
  password = NULL,
  baseUrl = "https://wrcc.dri.edu/cgi-bin/wea_list2.pl"
)

Arguments

wrccID

Station identifier (will be upcased).

startdate

Desired start date (integer or character representing YYYYMMDD[HH]).

enddate

Desired end date (integer or character representing YYYYMMDD[HH]).

password

Password required for access to archival data.

baseUrl

Base URL for data queries.

Value

String containing RAWS data.

References

RAWS USA Climate Archive

Examples

## Not run: 
# Fail gracefully if any resources are not available
try({

library(RAWSmet)

fileString <- wrcc_downloadData(wrccID = 'WENU')
cat(fileString)

# Using a password for archival data
fileString <- wrcc_downloadData(
  wrccID = "WENU",
  startdate = 20200801,
  enddate = 20200901,
  password = "MY_PASSWORD"
)

}, silent = FALSE)

## End(Not run)

MazamaScience/RAWSmet documentation built on May 6, 2023, 6:57 a.m.