as.xyz: Convert to xyz format

View source: R/as.xyz.R

as.xyzR Documentation

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)

Arguments

bathy

matrix of class bathy.

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.

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.

Author(s)

Benoit Simon-Bouhet

See Also

as.bathy, summary.bathy

Examples

# 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)


ericpante/marmap documentation built on April 4, 2023, 2:56 p.m.