Learn R Programming

RCMIP5 (version 1.2.0)

saveNetCDF: Save a cmip5data object to NetCDF format

Description

There are at least three ways to save a cmip5data object. First, save it. Second, use as.data.frame or as.array. Third, this function, which will write out a new NetCDF file readable by any NetCDF-aware software.

Usage

saveNetCDF(x, file = NULL, path = "./", verbose = FALSE, saveProvenance = TRUE, originalNames = FALSE)

Arguments

x
A cmip5data object
file
Filename; if omitted one will be generated automatically.
path
File path.
verbose
logical. Print info as we go?
saveProvenance
Save the provenance separately?
originalNames
logical. Use original dimension names from file?

Value

The fully-qualified filename that was written (invisible).

Details

If no filename is provided, a meaningful one will be assigned based on the CMIP5 naming convention (but appending 'RCMIP5'). The loadCMIP5 function should be able to read this file. If saveProvenance is specified, the provenance is saved separately in a comma-separated file of the same name but appending "_prov.csv". (Provenance messages are always saved as NetCDF file attributes.)