Description Usage Arguments Details Value Author(s)
View source: R/get_ts_from_shp.R
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.
1 2 | get_ts_from_shp(obj, weight_matrix = NULL, aggregate_function = "mean",
shapefile = "NUTS0", path_to_shapefile = NULL, cos_weighted = TRUE)
|
obj |
A gridded object: a grid structure from Climate4R functions or a |
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: |
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
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:
NUTS0-2
: Data from EUROSTAT NUTS (small islands removed) https://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/administrative-units-statistical-units/nutscountries_EU
eh2050
: cluster as defined in the FP7 e-Highway2050 project
hybas05
: HydroBASINS Level 5 (http://www.hydrosheds.org/page/hydrobasins)
hybas06
: HydroBASINS Level 6 (http://www.hydrosheds.org/page/hydrobasins)
WAPP
: WAPP catchments from the JRC LISFLOOD hydrological model
A list containing all the fields names ad shapefile_id_field
, each field contains aggregated the time-series
Matteo De Felice
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.