grid2sp: Grid to SpatialGridDataFrame or SpatialPointsDataFrame

View source: R/grid2sp.R

grid2spR Documentation

Grid to SpatialGridDataFrame or SpatialPointsDataFrame

Description

Convert a grid to a SpatialGridDataFrame object from package sp

Usage

grid2sp(grid)

Arguments

grid

A C4R grid

Details

This function was built based on function clim2sgdf

Value

A sp object of the class SpatialGridDataFrame or SpatialPointsDataFrame (Depending on the input grid). If the inpurt grid contains members (member dimension) a list of Spatial* objects is returned (each slot in the list is a member).

Author(s)

M. Iturbide

See Also

sp2grid

Examples


require(climate4R.datasets)
library(sp)
# Climatologies of different members:
data("CFS_Iberia_tas")
x <- grid2sp(climatology(CFS_Iberia_tas))
plot(x[1]) # Plot the first member

# Daily data:
x <- grid2sp(CFS_Iberia_tas)
plot(x[[1]][1]) # Plot the first day of the first member

data("EOBS_Iberia_tas")
x <- grid2sp(EOBS_Iberia_tas)
plot(x[1]) # Plot the first day


SantanderMetGroup/transformeR documentation built on Aug. 29, 2024, 6:42 a.m.