Learn R Programming

PAMmisc (version 1.12.4)

varSelect: Utility for Selecting Variables to Download

Description

Loops through the available variables in an edinfo object and asks whether or not each should be downloaded, then stores the result for passing on to formatURL

Usage

varSelect(edinfo, select = NULL)

Value

the same object as edinfo with an updated varSelect field

Arguments

edinfo

a datalist, either from getEdinfo or created by erddapToEdinfo

select

(optional) logical vector of which variables to select. If left as default NULL, user will be prompted to select which variables to keep. If not NULL, can either be a single TRUE to select all variables, or a logical vector of length equal to the number of variables in edinfo. Can also be a vector of variable names to select.

Author

Taiki Sakai taiki.sakai@noaa.gov

Examples

Run this code

sstEdi <- getEdinfo()[['jplMURSST41']]
if (FALSE) {
# interactively select
sstEdi <- varSelect(sstEdi)
}
# select all variables
sstEdi <- varSelect(sstEdi, TRUE)
# select the first two of four
sstEdi <- varSelect(sstEdi, c(TRUE, TRUE, FALSE, FALSE))

Run the code above in your browser using DataLab