clim2sgdf: Climatology to SpatialGridDataFrame or SpatialPointsDataFrame

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/sgdf2clim.R

Description

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

Usage

1
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

1
2
3
4
5
6
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 Feb. 14, 2020, 5:55 p.m.