View source: R/wrcc_downloadData.R
| wrcc_downloadData | R Documentation | 
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/.
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"
)
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.  | 
String containing RAWS data.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.