Learn R Programming

oce (version 0.9-18)

lookWithin: Look Within the First Element of a List for Replacement Values

Description

Look Within the First Element of a List for Replacement Values

Usage

lookWithin(list)

Arguments

list
A list of elements, typically arguments that will be used in sw functions.

Value

  • A list with elements of the same names but possibly filled in from the first element.

Details

This is a helper function used by various seawater functions. It is used for a call like swRho(ctd), in which the first argument, which is normally salinity may be an object that contains salinity plus the other items that swRho expects to see as arguments. This shorthand is very helpful in calls to the suite of sw functions. If this first argument is an object of this sort, then the other arguments are ignored except for one named eos, which is copied if it is present.