Make topography data suitable for the 'graphics::contour' and 'grDevices::contourLines' functions using freely available global seafloor topography data.
makeTopography (dat, digits=2, func=NULL)
Arguments
dat: data.frame -- data with three optionally-named columns: x, y, and z. The columns must appear in that order.
digits: numeric -- integer indicating the precision to be used by the function round on (x,y) values.
func: function -- to summarize z if (x,y) points are duplicated. Defaults to mean() if no function is specified.
Details
Suitable data can be obtained through the Topex acquisition form. The function 'utils::read.table' will import dowloaded ASCII files into R, creating objects suitable for the argument 'dat' in 'makeTopography'.
When creating data for regions with longitude values spanning -180degrees to 0degrees, consider subtracting 360 from the result's longitude coordinates (x).
When creating bathymetry data, consider negating the result's elevations (z) to give depths positive values.
Combinations of (x,y) do not need to be complete (z[x,y]=NA) or unique (z[x,y] = func(z[x,y])).
Returns
List with elements x, y, and z. Elements x and y are vectors, while z is a matrix with rownames x
and colnames y. The functions 'graphics::contour' and 'grDevices::contourLines'