ncwrite | R Documentation |
Write CMIP5 nc file
ncwrite(
lst,
file,
var.units = NULL,
var.longname = NULL,
prec = "float",
dims = NULL,
dimnames_last = NULL,
range = c(-180, 180, -90, 90),
dates = NULL,
calendar = "gregorian",
missval = -9999L,
compression = 1,
scale,
offset,
attrs,
overwrite = FALSE,
verbose = FALSE
)
ncwrite_raster2(r, file, dims = NULL, dimnames_last, overwrite = TRUE, ...)
lst |
A named list of 3d arrays, which have the dimension of |
file |
Name of the netCDF file to be created. |
var.units |
untis of variables in |
var.longname |
longname of variables in |
prec |
Precision of the created variable. Valid options: 'short' 'integer' 'float' 'double' 'char' 'byte'. See the special note below for how to create a character variable (strings). short: -32768 - 32768. |
range |
A numeric vector, |
dates |
A |
missval |
The variable's missing value. If NO missing value is desired, pass a NULL, or omit this argument entirely. If a NaN missing value is desired, pass an NA. |
compression |
If set to an integer between 1 (least compression) and 9 (most compression), this enables compression for the variable as it is written to the file. Turning compression on forces the created file to be in netcdf version 4 format, which will not be compatible with older software that only reads netcdf version 3 files. |
scale, offset |
If the variable in the netCDF file has a scale and/or offset attribute defined, the returned data are automatically and silently scaled and/or offset as requested. Then you should just leave scale = 1, and offset = 0. |
attrs |
A named list of global attributes, e.g. title, author, souce, references, institution. |
verbose |
Print debugging information. |
r |
|
... |
other parameters to ncwrite |
varname |
variable name in the data of |
ncread_cmip()
, ncdf4::ncvar_def()
## Not run:
range_china = c(70, 140, 15, 55)
ncwrite(list(Tmin = arr[,,1:2]), "Tmin.nc", "degC", range = range_china,
prec = "short", scale = 0.01, offset = 10,
dates = dates)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.