get_ts_from_shp: Aggregate a gridded object into national or regional...

Description Usage Arguments Details Value Author(s)

View source: R/get_ts_from_shp.R

Description

The function spatially aggregates using a function (for example, mean) all the grid points within the borders defined by a shapefile. The function provides some shapefiles for Europe.

Usage

1
2
get_ts_from_shp(obj, weight_matrix = NULL, aggregate_function = "mean",
  shapefile = "NUTS0", path_to_shapefile = NULL, cos_weighted = TRUE)

Arguments

obj

A gridded object: a grid structure from Climate4R functions or a list with lat, lon and data fields. See Details section for further details.

weight_matrix

A matrix to be used as weight when aggregating

aggregate_function

The function to be used to aggregate the grid points. Options are: mean and sum

shapefile

The shapefile to be used to aggregate the grid points.

cos_weighted

Define if the grid points will be weighted according the cosine of the latitude

Details

Details The obj can be: 1. a list with three mandatory fields: lat with the latitude values, lon with the longitude and data with the gridded field consistent with the coordinates; 2. a grid structure as in the Climate4R bundle (http://www.meteo.unican.es/climate4R), for example from loadeR package.

The shapefiles available are the following:

Value

A list containing all the fields names ad shapefile_id_field, each field contains aggregated the time-series

Author(s)

Matteo De Felice


matteodefelice/panas documentation built on March 4, 2020, 4:19 a.m.