stage_nwis_ts: stage nwis data into a file

View source: R/stage_nwis_ts.R

stage_nwis_tsR Documentation

stage nwis data into a file

Description

get data from nwis and return created file handle

Usage

stage_nwis_ts(sites, var, times, folder = tempdir(), version = c("rds",
  "tsv"), verbose = FALSE)

Arguments

sites

a character vector of valid NWIS site IDs

var

short name of variable as in unique(get_var_src_codes(out="var"))

times

a length 2 vector of text dates in YYYY-MM-DD format

folder

a folder to place the file outputs in (defaults to temp directory)

version

character string indicating whether you want to stage the ts as an .rds or .tsv

verbose

provide verbose output (currently not implemented)

Value

a character vector of file handles

Examples


## Not run: 

files <- stage_nwis_ts(sites = c("nwis_06893820","nwis_01484680"), 
  var = "doobs", times = c('2014-01-01','2014-01-02'), verbose=TRUE)
head(read_ts(files[1]))

# par is unavailable for all sites, so returns NULL
stage_nwis_ts(sites = list_sites(), var = "par",
  times = c('2014-01-01', '2014-01-03'), verbose=TRUE) 

## End(Not run)

USGS-R/mda.streams documentation built on June 3, 2023, 8:43 a.m.