downloadEnv: Download Environmental Data

View source: R/downloadEnv.R

downloadEnvR Documentation

Download Environmental Data

Description

Downloads environmental data matching the coordinates in a set of data

Usage

downloadEnv(
  data,
  edinfo,
  fileName = NULL,
  buffer = c(0, 0, 0),
  timeout = 120,
  progress = TRUE,
  ...
)

Arguments

data

Data containing Longitude, Latitude, and UTC to download matching environmental data for

edinfo

either a edinfo object from getEdinfo or erddapToEdinfo or an ERDDAP dataset ID

fileName

name of the file to save downloaded data. If left as the default NULL, data will be saved to a temporary folder

buffer

numeric vector of the amount to buffer the Longitude, Latitude, and UTC coordinates by

timeout

number of seconds before timeout stops download attempt

progress

logical flag to show download progress

...

not used

Value

if download is successful, invisibly returns the filename. If it fails returns FALSE.

If successful, the file name of downloaded data. If not, returns FALSE

Author(s)

Taiki Sakai taiki.sakai@noaa.gov

Examples


data <- data.frame(Latitude = 32, Longitude = -117,
                   UTC = as.POSIXct('2000-01-01 00:00:00', tz='UTC'))
## Not run: 
# not run because download could take time
# download jplMURSST41 dataset
edi <- erddapToEdinfo('jplMURSST41')
ncFile <- downloadEnv(data, edi, 'sstData.nc')

# browse suggested sst datasets, then download
edi <- browseEdinfo(var='sst')
ncFile <- downloadEnv(data, edi, 'sstData.nc')

## End(Not run)



PAMmisc documentation built on June 22, 2024, 9:37 a.m.