getField | R Documentation |
Field
from a Source
Given a Source
object and a Quantity
object, return an appropriate spatially/temporal/annually-aggregated Field
object, optionally including
spatial, temporal and annual cropping.
getField(
source,
quant,
layers = NULL,
file.name = NULL,
first.year = NULL,
last.year = NULL,
year.aggregate.method = NULL,
spatial.extent = NULL,
spatial.extent.id = NULL,
spatial.aggregate.method = NULL,
subannual.resolution = NULL,
subannual.original = NULL,
subannual.aggregate.method = NULL,
sta.info = NULL,
quick.read.file = NULL,
quick.read.autodelete = FALSE,
verbose = FALSE,
...
)
source |
The |
quant |
The \codeQuantity to be read - either a |
layers |
A list (or vector of character) of character strings to specify which Layers should be read from the file.
If missing or NULL then all Layers are read.
-NOTE- Using this arguments is not recommended for reading gzipped output with the |
file.name |
Character string specifying the file name (not the full path, just the file name, or the file name relative to source@dir) where the data is stored.
For the |
first.year |
The first year (as a numeric) of the data to be returned (if not specified or NULL start from the beginning of the data set) |
last.year |
The last year (as a numeric) of the data to be returned (if not specified or NULL take the data to the end of the data set) |
year.aggregate.method |
A character string describing the method by which to annual aggregate the data. Leave blank to apply no annual aggregation. Can currently be "mean", "sum", "max", "min", "sd", "var and "cv" (= coefficient of variation: sd/mean).
For technical reasons these need to be implemented in the package in the code however it should be easy to implement more, please just contact the author!
See |
spatial.extent |
An extent in space to which this Field should be cropped, supplied as a raster::extent object or an object from which a raster::extent object can be derived - eg. a Raster* object or another Field object. |
spatial.extent.id |
A character string to give an identifier for the spatial extent this Field covers. |
spatial.aggregate.method |
A character string describing the method by which to spatially aggregate the data. Leave blank to apply no spatial aggregation. Can currently be "weighted.mean"/"w.mean", "mean",
"weighted.sum"/"w.sum", "sum", "max", "min", "sd", "var and "cv" (= coefficient of variation: sd/mean). For technical reasons these need to be implemented in the package in the code however it should be easy to implement more, please just contact the author!
See |
subannual.resolution |
A character string specifying the subannual resolution that you want. Can be "Year", "Month" or "Day". |
subannual.original |
A character string specifying the subannual you want the data to be on before applying the subannual.aggregate.method. Can be "Year", "Month" or "Day". Currently ignored. |
subannual.aggregate.method |
A character string specifying the method by which to aggregate the data subannually, can be "mean", "sum", "max", "min", "sd", "var and "cv" (= coefficient of variation: sd/mean)
See |
sta.info |
Optionally an |
quick.read.file |
A character string. If set, the function will look for a file of this name (plus the extension ".RData") in the run directory. If if finds one then it reads that. If it doesn't find the appropriate file, then it reads the raw data, performs whatever cropping and aggregating is necessary, and then saves the data in a file of that name (in the run directory) for use next time. (Note: the function also checks that the specified layers, cropping and aggregating found in the file match that which was requested by the arguments here). |
quick.read.autodelete |
If TRUE then the file specified by the above "quick.read.file" argument will be deleted, thus ensuring that the raw data will be read afresh (and saved again). Ignored if valid "quick.read.file" argument not supplied. |
verbose |
If TRUE give a lot of information for debugging/checking. |
... |
Other arguments that are passed to the getField function for the specific Format or additional arguements for selecting space/time/years. For all Formats, the followings arguments apply:
For the aDGVM(1) Format, the following arguments apply:
For the aDGVM2 Format, the following arguments apply:
For the NetCDF Format, the following arguments apply:
|
Note that because there are three types of aggregating available, the resulting Field
object can have a wide select of spatio-temporal dimensions.
To check what dimensions you have you can use getDimInfo
A Field
.
Matthew Forrest matthew.forrest@senckenberg.de
aggregateSubannual
, aggregateSpatial
, aggregateYears
, getDimInfo
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.