Learn R Programming

envirem (version 3.0)

pacificCentric: Center raster on the Pacific

Description

Takes a raster that is centered on 0 longitude (default) and recenters it on the Pacific

Usage

pacificCentric(r, crop = TRUE)

Value

rasterLayer or SpatRaster

Arguments

r

rasterLayer or SpatRaster in unprojected geographic coordinates

crop

logical, should raster then be cropped to longitude [100, 300]

Author

Pascal Title

Details

Cropping to [100, 300] is equivalent to [100, -60]

Examples

Run this code
# Find example rasters
rasterFiles <- list.files(system.file('extdata', package='envirem'), full.names=TRUE)
tmin1 <- rast(grep('tmin_1\\.', rasterFiles, value=TRUE))

pacificCentric(tmin1, crop = TRUE)

Run the code above in your browser using DataLab