Learn R Programming

marmap (version 1.0.3)

as.raster: Convert bathymetric data to a raster layer

Description

Transforms an object of class bathy to a raster layer.

Usage

as.raster(bathy)

Arguments

bathy

an object of class bathy

Value

An object of class RasterLayer with the same characteristics as the bathy object (same longitudinal and latitudinal ranges, same resolution).

Details

as.raster transforms bathy objects into objects of class RasterLayer as defined in the raster package. All methods from the raster package are thus available for bathymetric data (e.g. rotations, projections...).

See Also

as.xyz, as.bathy, as.SpatialGridDataFrame

Examples

Run this code
# NOT RUN {
# load Hawaii bathymetric data
data(hawaii)

# use as.raster
r.hawaii <- as.raster(hawaii)

# class "RasterLayer"
class(r.hawaii)

# Summaries
summary(hawaii)
summary(r.hawaii)

# structure of the RasterLayer object
str(r.hawaii)

# }
# NOT RUN {
# Plots
#require(raster)
plot(hawaii,image=TRUE,lwd=.2)
plot(r.hawaii)
# }

Run the code above in your browser using DataLab