download_ts: Download timeseries data to local file destination

View source: R/download_ts.R

download_tsR Documentation

Download timeseries data to local file destination

Description

Download a timeseries file to a user-specified (or temp file) location

Usage

download_ts(var_src, site_name, folder = tempdir(), version = c("rds",
  "tsv"), on_remote_missing = c("stop", "return_NA"),
  on_local_exists = c("stop", "skip", "replace"))

Arguments

var_src

a valid variable name for timeseries data (see get_var_src_codes(data_type=='ts')$var_src)

site_name

a valid mda.streams site (see list_sites)

folder

string for a folder location

version

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

on_remote_missing

character indicating what to do if the remote file is missing

on_local_exists

character indicating what to do if the folder already contains a file with the intended download name

Value

file handle (character path) for the downloaded file, or NA if the timeseries is unavailable on ScienceBase

Author(s)

Alison P Appling, Corinna Gries, Jordan S Read, Luke A Winslow

Examples

## Not run: 
download_ts(var_src = c('doobs_nwis','baro_nldas'), site_name = 'nwis_06893300')
download_ts(var_src = c('doobs_nwis','baro_nldas'), site_name = 'nwis_06893300')
download_ts(var_src = c('doobs_nwis','baro_nldas'), site_name = 'nwis_06893300', 
  on_local_exists="skip")

## End(Not run)

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