Learn R Programming

RCMIP5 (version 1.0)

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

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 filtering.

Usage

filterDimensions(x, lons = NULL, lats = NULL, Zs = NULL, years = NULL,
  months = NULL, verbose = FALSE)

Arguments

x
A cmip5data object
lons
numeric vector. Longitudes to filter
lats
numeric vector. Latitudes to filter
Zs
numeric vector. Z values to filter
years
numeric vector
months
numeric vector
verbose
logical. Print info as we go?

Value

Examples

Run this code
d <- cmip5data(1970:2014)   # sample data
filterDimensions(d, years=1980:1985)
filterDimensions(d, months=6:8)  # summer
filterDimensions(d, lats=d$lat[abs(d$lat)<20])  # the tropics

Run the code above in your browser using DataLab