fetch: Get files

View source: R/fetch.R

fetchR Documentation

Get files

Description

Get files

Usage

fetch(x, ..., fields = "all", stride = 1, fmt = "nc", url = durl(),
  store = disk(), read = TRUE, callopts = list())

Arguments

x

input

...

Dimension arguments. See examples. Can be any 1 or more of the dimensions for the particular dataset - and the dimensions vary by dataset. For each dimension, pass in a vector of length two, with min and max value desired.

fields

(character) Fields to return, in a character vector.

stride

(integer) How many values to get. 1 = get every value, 2 = get every other value, etc. Default: 1 (i.e., get every value)

fmt

(character) One of csv or nc (for netcdf). Default: nc

url

A URL for an OpenDAP server. Default: https://goldsmr2.sci.gsfc.nasa.gov/opendap/

store

One of disk (default) or memory. You can pass options to disk

read

(logical) Read data into memory or not. Does not apply when store parameter is set to memory (which reads data into memory). For large csv, or especially netcdf files, you may want to set this to FALSE, which simply returns a summary of the dataset - and you can read in data piecemeal later. Default: TRUE

callopts

Pass on curl options to GET

Value

Prints a summary of the data on return, but you can index to various information.

Author(s)

Scott Chamberlain <myrmecocystus@gmail.com>

Examples

## Not run: 
fetch(id = "MERRA_MONTHLY/MSTMNXMLD.5.2.0/2015/MERRA300.prod.simul.tavgM_2d_mld_Nx.201507.hdf")

# NASA's ocean color data
url <- 'https://oceandata.sci.gsfc.nasa.gov/opendap/'
fetch('MODISA/L3SMI/2015/006/A2015006.L3m_DAY_IOP_a_412_giop_4km.nc', url = url)

x <- "MODISA/L3SMI/2015/006/A2015006.L3m_DAY_IOP_aph_unc_443_giop_9km.nc.nc4"

## End(Not run)

ropensci/dappr documentation built on May 18, 2022, 9:51 a.m.