Learn R Programming

oce (version 1.0-1)

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 two special cases:

  • an item named eos is copied directly from list

  • if the object stores temperature defined with the IPTS-68 scale, then T90fromT68 is used to convert to the ITS-90 scale, because this is what is expected in most seawater functions. (For example, the RMS difference between these temperature variants is 0.002C for the ctd dataset.)