saveNetCDF: Save a cmip5data object to NetCDF format

Description Usage Arguments Details Value Note

View source: R/saveNetCDF.R

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

1
2
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?

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.)

Value

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

Note

This function requires the ncdf4 package; ncdf is not supported.


RCMIP5 documentation built on May 1, 2019, 6:28 p.m.