download_item_files: Download file[s] to local destination

View source: R/download_item_files.R

download_item_filesR Documentation

Download file[s] to local destination

Description

Download one or more files to a user-specified (or temp file) location

Usage

download_item_files(item_ids, item_names, files = NA, folder = tempdir(),
  on_remote_missing = c("stop", "return_NA"), on_local_exists = c("stop",
  "skip", "replace"))

Arguments

item_ids

the item id[s], or NA if an id could not be found. an item_id will be ignored in the very special (but potentially common and speedy) case that files is specified (not NA), all specified files for an item are already available locally, and on_local_exists=='skip'.

item_names

character names by which to refer to the respective items in messages

files

list of character vector[s] of file names to download, one list element per item_ids. if the default is used, all files from each site will be downloaded. may also be passed as a single character vector to be replicated once for each item_id

folder

string for a folder location where files should be saved, or a vector of as many folders as there are item_ids

on_remote_missing

character indicating what to do if the

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_item_files(item_id, on_local_exists="replace")

## End(Not run)

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