Learn R Programming

marmap (version 1.0.10)

as.xyz: Convert to xyz format

Description

Converts a matrix of class bathy into a three-column data.frame containing longitude, latitude and depth data.

Usage

as.xyz(bathy)

Value

Three-column data.frame with a format similar to xyz files downloaded from the NOAA GEODAS Grid Translator webpage (https://maps.ngdc.noaa.gov/viewers/wcs-client/). The first column contains longitude data, the second contains latitude data and the third contains depth/elevation data.

Arguments

bathy

matrix of class bathy.

Author

Benoit Simon-Bouhet

Details

The use of as.bathy and as.xyz allows to swicth back and forth between the long format (xyz) and the wide format of class bathy suitable for plotting bathymetric maps, computing least cost distances, etc. as.xyz is especially usefull for exporting xyz files when data are obtained using subsetSQL, i.e. bathymetric matrices of class bathy.

See Also

as.bathy, summary.bathy

Examples

Run this code
# load celt data
data(celt)
dim(celt)
class(celt)
summary(celt)
plot(celt,deep= -300,shallow= -25,step=25)

# use as.xyz
celt2 <- as.xyz(celt)
dim(celt2)
class(celt2)
summary(celt2)

Run the code above in your browser using DataLab