# NOT RUN {
## Create a new NetCDF dataset and define two dimensions
file1 <- tempfile("dim.rename_", fileext=".nc")
nc <- create.nc(file1)
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)
unlink(file1)
# }
Run the code above in your browser using DataLab