setGridProj: Set grid projection

View source: R/helpers.R

setGridProjR Documentation

Set grid projection

Description

Set the "projection" attribute of a climate4R grid

Usage

setGridProj(grid, proj = NULL)

Arguments

grid

An input grid

proj

Character string. A string specifying the projection attribute value. See details.

Details

The projection string format is free, although usually a valid epsg code or proj4 string is introduced here.

Value

Returns (invisible) the same input grid with the new "projection" attribute in "$xyCoords" list element.

Author(s)

J Bedia

See Also

Other get.helpers: get2DmatCoordinates(), getCoordinates(), getDim(), getGridProj(), getGridVerticalLevels(), getGrid(), getRefDates(), getSeason(), getShape(), getStationID(), getVarNames(), getWT(), getYearsAsINDEX(), typeofGrid(), which.leap()

Examples

 
require(climate4R.datasets)
data(NCEP_Iberia_hus850)
getGridProj(NCEP_Iberia_hus850)
# We introduce the standard definition of WGS84 lat-lon projection
NCEP_Iberia_hus850 <- setGridProj(NCEP_Iberia_hus850,
                                  proj= "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs")
getGridProj(NCEP_Iberia_hus850)                 
                  

SantanderMetGroup/transformeR documentation built on Oct. 28, 2023, 5:26 a.m.