cmip5data: The 'cmip5data' class

Description Usage Arguments Value Examples

View source: R/RCMIP5.R

Description

This constructor has two functions. First, given a list, it makes the list a cmip5data-class object (no check is made that the list has appropriate fields though). Second, if given a numeric value(s), it returns sample/ example data in the newly constructed object. This is used extensively by the testing code.

Usage

1
2
3
4
cmip5data(x = list(), lonlat = TRUE, lonsize = 10, latsize = 10,
  Z = FALSE, Zsize = 5, time = TRUE, monthly = TRUE,
  randomize = FALSE, irregular = FALSE, verbose = FALSE,
  loadAs = "data.frame")

Arguments

x

A list or numeric. If x is a list then the fields are expected to match those of the returned cmip5data object. If x is a numeric sample data is created where the numeric indicates the years of sample data to return.

lonlat

Boolean indicating whether to create lon and lat dimensions

lonsize

Integer size of longitude dimension

latsize

Integer size of latitude dimension

Z

logical. Create Z dimension?

Zsize

integer. Size of Z dimension

time

logical. Create time dimension?

monthly

logical. Monthly (if not, annual) data?

randomize

logical. Random sample data?

irregular

logical. Irregular lon/lat grid?

verbose

logical. Print info as we go?

loadAs

a string identifying possible structures for values. Currently: 'data.frame' and 'array' the only valid options.

Value

A cmip5data object, which is a list with the following fields:

files

Array of strings containg the file(s) included in this dataset

variable

String containg the variable name described by this dataset

model

String containing the model name of this dataset

experiment

String containing the experiment name of this dataset

ensembles

Array of strings containg the ensemble(s) included in this dataset

domain

String containing the domain name of this dataset

val

Data frame holding data, with fields lon, lat, Z, time

valUnit

String containing the value units

lon

Numeric vector containing longitude values; may be NULL

lat

Numeric vector containing latitude values; may be NULL

Z

Numeric vector Z values; may be NULL

time

Numeric vector containing time values; may be NULL

dimNames

Array of strings containing the original (NetCDF) dimension names

calendarStr

String defining the calendar type; may be NULL

debug

List with additional data (subject to change)

provenance

Data frame with the object's provenance. See addProvenance

numPerYear

Numeric vector; only present after makeAnnualStat

numYears

Numeric vector; only present after makeMonthlyStat

numCells

Numeric vector; only present after makeGlobalStat

filtered

Logical; only present after filterDimensions

Examples

1
2
3
4
5
6
7
cmip5data(1970)  # produces monthly sample data for year 1970
cmip5data(1970:2014)
cmip5data(1970:2014, monthly=FALSE)  # annual data
cmip5data(1970:2014, randomize=TRUE) # randomized data
cmip5data(1970:2014, Z=TRUE)  # four-dimensional data
cmip5data(0, time=FALSE)  # sample 'fx' data, two-dimensional
cmip5data(list())  # makes this (here empty) list class into 'cmip5data'

RCMIP5 documentation built on May 1, 2019, 6:28 p.m.