Learn R Programming

marmap (version 1.0.10)

read.bathy: Read bathymetric data in XYZ format

Description

Reads a three-column table containing longitude (x), latitude (y) and depth (z) data.

Usage

read.bathy(xyz, header = FALSE, sep = ",", ...)

Value

The output of read.bathy is a matrix of class bathy, which dimensions depends on the resolution of the grid uploaded from the NOAA GEODAS server (Grid Cell Size). The class bathy has its own methods for summarizing and ploting the data.

Arguments

xyz

three-column table with longitude (x), latitude (y) and depth (z) (no default)

header

whether this table has a row of column names (default = FALSE)

sep

character separating columns, (default=",")

...

further arguments to be passed to read.table()

Author

Eric Pante

Details

Allows direct import of data from the NOAA GEODAS Grid Translator webpage (https://maps.ngdc.noaa.gov/viewers/wcs-client/). To prepare data from NOAA, fill the custom grid form, and choose "XYZ (lon,lat,depth)" as the "Output Grid Format", "No Header" as the "Output Grid Header", and either of the space, tab of comma as the column delimiter (either can be used, but "comma" is the default import format of read.bathy). Choose "omit empty grid cells" to reduce memory usage.

See Also

summary.bathy, plot.bathy, readGEBCO.bathy

Examples

Run this code
# load NW Atlantic data
data(nw.atlantic)

# write example file to disk
write.table(nw.atlantic, "NW_Atlantic.csv", sep=",", quote=FALSE, row.names=FALSE)

# use read.bathy
read.bathy("NW_Atlantic.csv", header=TRUE) -> atl

# remove temporary file
system("rm NW_Atlantic.csv") # remove file, for unix-like systems

# class "bathy"
class(atl)

# summarize data of class "bathy"
summary(atl)

Run the code above in your browser using DataLab