summarypoints: Summaries of meteorological data

Description Usage Arguments Value Author(s) See Also Examples

Description

Summarizes the meteorology of a single location, a set of spatial points, pixels in a grid, or weather stations of interpolation data.

Usage

1
2
3
4
5
6
summarypoint(x, var, fun = mean, freq = NULL, dates = NULL, months = NULL, ...)
summarypoints(points, var, fun = mean, freq = NULL, dates = NULL, months = NULL, ...)
summarygrid(griddata, dates = NULL)
summarypixels(pixelsdata, dates = NULL)
summaryinterpolationdata(object, var, fun = mean, freq = NULL, dates = NULL, 
                         months = NULL, ...)

Arguments

x

A data frame with dates in rows and meteorological variables in columns.

points

An object of class SpatialPointsMeteorology-class with the coordinates and meteorological data of the locations for which summaries are desired. Alternatively, an object of class SpatialPointsDataFrame-class containing the meta data (columns dir, filename and possibly format) of meteorological files that will be sequentially read from the disk.

var

The name of the meteorological variable to be summarized.

fun

The function to be calculated on values of each point. If freq is specified, the function will be calculated by intervals.

freq

A string giving an interval specification (e.g., "week", "month", "quarter" or "year"). If NULL then no intervals are defined.

dates

An object of class Date to define the period to be summarized. If dates = NULL then all dates in points are processed.

months

A numeric vector to indicate the subset of months for which summary is desired (e.g. c(7,8) for July and August). This parameter allows studing particular seasons, when combined with freq. For example freq = "years" and months = 6:8 leads to summarizing summer months of each year.

...

Additional parameters to fun.

griddata

An object of class SpatialGridMeteorology-class with the meteorological data for a grid. Alternatively, a data.frame containing the meta data (columns dir and filename) of grid meteorological files that will be sequentially read from the disk.

pixelsdata

An object of class SpatialPixelsMeteorology-class with the meteorological data for a set of grid cells. Alternatively, a data.frame containing the meta data (columns dir and filename) of grid meteorological files that will be sequentially read from the disk.

object

An object of class MeteorologyInterpolationData-class.

Value

Function summarypoint returns a named vector of values with dates as names. Functions summarypoints and summaryinterpolatoiondata return an object of class SpatialPointsDataFrame containing summaries (either one variable or several if freq is specified). Functions summarygrid and summarypixels return an object of class SpatialGridDataFrame and SpatialPixelsDataFrame, respectively, containing the summary of all meteorogical variables (sums or precipitation and PET; means for the other variables) calculated over the specified period.

Author(s)

Miquel De Cáceres Ainsa, CTFC

Antoine Cabon,CTFC

See Also

SpatialPointsMeteorology-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(examplegridtopography)
data(exampleinterpolationdata)

#Creates spatial topography points from the grid
p = 1:2
spt = as(examplegridtopography, "SpatialPointsTopography")[p]

#Interpolation of two points for the whole time period (2000-2003)
mp = interpolationpoints(exampleinterpolationdata, spt)

#PET sums by months
mp.sum = summarypoints(mp, var="PET", freq="months")

mp.sum

miquelcaceres/meteoland documentation built on May 8, 2019, 11:57 p.m.