clim2sgdf: Climatology to SpatialGridDataFrame or SpatialPointsDataFrame

View source: R/sgdf2clim.R

clim2sgdfR Documentation

Climatology to SpatialGridDataFrame or SpatialPointsDataFrame

Description

Convert a climatological climate4R grid to a SpatialGridDataFrame object from package sp. See details.

Usage

clim2sgdf(clim, set.min = NULL, set.max = NULL)

Arguments

clim

A climatological grid, as returned by function climatology

set.min

Minimum value, as passed by spatialPlot

set.max

Maximum value, as passed by spatialPlot

Details

This function is intended for internal usage by spatialPlot, that accepts all possible arguments that can be passed to spplot for plotting. However, it may be useful for advanced sp users in different contexts (e.g. for reprojecting via spTransform etc.).

Note that the function can be only applied to “climatological” climate4R grids, i.e., grids whose time dimension is a singleton, typically after the application of function climatology, although not necessarily so.

Value

A sp object of the class SpatialGridDataFrame

Author(s)

J. Bedia

See Also

climatology, spatialPlot

sgdf2clim, to perform the reverse operation

Examples


require(climate4R.datasets) 
data("CFS_Iberia_tas")
# Climatology is computed:
clim <- climatology(CFS_Iberia_tas, by.member = TRUE)
sgdf <- clim2sgdf(clim, NULL, NULL)
class(sgdf)
sp::spplot(sgdf)


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