Learn R Programming

meteoland (version 0.9.7)

extractdates: Extracts meteorological data

Description

Extracts meteorological data from an object.

Usage

extractdates(object, dates = NULL, verbose=FALSE)
extractvars(object, vars, verbose=FALSE)
extractgridindex(grid, index)
extractgridpoints(grid, points, verbose=FALSE)

Arguments

dates

A vector of Date with a (subset) of dates to be extracted. If NULL all dates will be returned.

vars

A character vector with the set of variables to be extracted.

grid

An object of class SpatialGridMeteorology-class or SpatialPixelsMeteorology-class with the meteorological data for a full grid or a subset of grid cells, respectively. Alternatively, a string specifying a NetCDF to be read from the disk.

index

An integer with a grid index.

points

An object of class SpatialPoints.

verbose

Boolean flag to print process information.

Value

  • Function extractdates(), returns a list with the same length as dates. Each element of the list is a spatial object (SpatialPointsDataFrame, SpatialGridDataFrame or SpatialPixelsDataFrame, depending on the input) with the meteorological data for all the spatial elements. If only one date is asked, the function returns directly the spatial object, without embedding it into a list.

  • Function extractvars(), returns a list with the same length as vars. Each element of the list is a spatial object (SpatialPointsDataFrame, SpatialGridDataFrame or SpatialPixelsDataFrame, depending on the input) with the meteorological data for all the spatial elements. If only one variable is asked, the function returns directly the spatial object, without embedding it into a list.

  • Function extractgridindex() returns a data frame.

  • Function extractgridpoints() returns an object of class SpatialPointsMeteorology.

Details

Function extractpoints is deprecated, because its functionality can be achieved using subsetting of spatial classes SpatialGridMeteorology and SpatialPixelsMeteorology.