Learn R Programming

amber (version 1.0.3)

intFun.coast: Reproject coastline

Description

This function reprojects the coastline for a specified domain.

Usage

intFun.coast(my.xlim, my.ylim,
  my.projection = "+proj=longlat +ellps=WGS84", shp.filename)

Arguments

my.xlim

An R object with minimum and maximum longitude, e.g. c(-171, -23)

my.ylim

An R object with minimum and maximum latitude, e.g. c(32, 75)

my.projection

An R string that defines the desired projection, e.g. '+proj=ob_tran +o_proj=longlat +o_lon_p=83. +o_lat_p=42.5 +lon_0=263.'

shp.filename

An R string that gives the name of a shapefile that should be reprojected

Value

Reprojected coastline

Examples

Run this code
# NOT RUN {
library(rgdal)
library(rgeos)
my.xlim <- c(-171, -23)
my.ylim <- c(32, 75)
my.projection <- '+proj=ob_tran +o_proj=longlat +o_lon_p=83. +o_lat_p=42.5 +lon_0=263.'
shp.filename <- system.file('extdata/ne_110m_land/ne_110m_land.shp', package = 'amber')
land <- intFun.coast(my.xlim, my.ylim, my.projection, shp.filename)
raster::plot(land)

# }

Run the code above in your browser using DataLab