R: Rename a NetCDF Dimension

dim.rename.nc {RNetCDF} | R Documentation

## Rename a NetCDF Dimension

### Description

Rename a NetCDF dimension.

### Usage

    dim.rename.nc(ncfile, dimension, newname)

### Arguments

`ncfile` | Object of class "`NetCDF`" which points to the NetCDF dataset (as returned from `open.nc`).
`dimension` | Either the ID or the name of the dimension to be renamed.
`newname` | The new dimension name.

### Details

This function renames an existing dimension in a NetCDF dataset open for writing. A dimension cannot be renamed to have the same name as another dimension.

### Author(s)

Pavel Michna

### References

http://www.unidata.ucar.edu/software/netcdf/

### Examples

    ##  Create a new NetCDF dataset and define two dimensions
    nc <- create.nc("dim.rename.nc")

    dim.def.nc(nc, "station", 5)
    dim.def.nc(nc, "time", unlim=TRUE)

    ##  Rename the dimensions
    dim.rename.nc(nc, 0, "mystation")
    dim.rename.nc(nc, "time", "mytime")

    close.nc(nc)

[Package RNetCDF version 1.9-1 Index]