Description Usage Arguments Value Examples
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.
1 2 3 4 |
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. |
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 |
lat |
Numeric vector containing latitude values; may be |
Z |
Numeric vector Z values; may be |
time |
Numeric vector containing time values; may be |
dimNames |
Array of strings containing the original (NetCDF) dimension names |
calendarStr |
String defining the calendar type; may be |
debug |
List with additional data (subject to change) |
provenance |
Data frame with the object's provenance. See |
numPerYear |
Numeric vector; only present after |
numYears |
Numeric vector; only present after |
numCells |
Numeric vector; only present after |
filtered |
Logical; only present after |
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'
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.