nc_apply | R Documentation |
Apply Functions Over Dimensions of a netCDF variable.
nc_apply( filename, varid, MARGIN, FUN, ..., output = NULL, drop = FALSE, newdim = NULL, name = NULL, longname = NULL, units = NULL, compression = NA, verbose = FALSE, force_v4 = TRUE, ignore.case = FALSE )
filename |
Name of the existing netCDF file to be opened. |
varid |
What variable to read the data from. Can be a string with the name of the variable or an object of class ncvar4. If set to NA, the function will determine if there is only one variable in the file and, if so, read from that, but if there are multiple variables in the file, an error is generated. |
MARGIN |
a vector giving the dimensions which the function will be applied over. It can be a character vector selecting dimension names. |
FUN |
the function to be applied |
... |
optional arguments to FUN. |
output |
Name of the file to save results. |
drop |
Logical. Drop degenered dimensions (i.e. dimensions of length 1)? Not implemented. |
newdim |
the values to be assigned a the dimension resulting from the application of FUN. |
name |
new name of the resulting variable. If NULL (by default), the original name is kept. |
longname |
long name of the resulting variable. |
units |
units of the resulting variable. |
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. |
verbose |
Print debugging information. |
force_v4 |
If TRUE, then the created output file will always be in netcdf-4 format (which supports more features, but cannot be read by version 3 of the netcdf library). If FALSE, then the file is created in netcdf version 3 format UNLESS the user has requested features that require version 4. Deafult is TRUE. |
ignore.case |
If TRUE, ignore case in matching dimension names and MARGIN. Default is FALSE. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.