Learn R Programming

RCMIP5 (version 1.2.0)

filterDimensions: Filter dimensions, limiting to arbitrary lon/lat/Z/time ranges

Description

We frequently want to filter CMIP5 data according to some predetermined criteria: only high-latitude cells, for example, or certain years, months, Zs, etc. This function provides convenient one-stop service for such tasks.

Usage

filterDimensions(x, lonRange = NULL, latRange = NULL, ZRange = NULL, yearRange = NULL, monthRange = NULL, verbose = FALSE)

Arguments

x
A cmip5data object
lonRange
Longitude values (min, max) to filter data against
latRange
Latitude values (min, max) to filter data against
ZRange
Z values (min, max) to filter data against
yearRange
Years (min, max) to filter data against
monthRange
Months (min, max) to filter data against
verbose
logical. Print info as we go?

Value

The filtered cmip5data object.

Examples

Run this code
d <- cmip5data(1970:2014)   # sample data
filterDimensions(d, yearRange=c(1980, 1985))
filterDimensions(d, monthRange=c(6, 8))  # summer
filterDimensions(d, latRange=c(-20, 20))  # the tropics
filterDimensions(d, latRange=c(-20, 20), monthRange=c(6, 8))  # tropical summer

Run the code above in your browser using DataLab