argfix: Reshape list elements to match that of the first element

Description Usage Arguments Value

View source: R/gsw.R


This is mainly used within gsw, to ensure that arguments sent to the C functions are of equal length. This is a convenience, for processing data that often have this condition. For example, a CTD profile is likely to have many values for SP, t, and p, but just a single value for each of longitude and latitude. It is important to call argfix() to handle such cases, because otherwise the underlying C code will be looking past the end of the vectors storing longitude and latitude, which can yield odd results or even segmentation faults.





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


A list with all elements of same shape (length or dimension).

gsw documentation built on July 8, 2021, 1:07 a.m.