# NOT RUN {
## Create a new NetCDF dataset and define a group
file1 <- tempfile("grp.rename_", fileext=".nc")
nc <- create.nc(file1, format="netcdf4")
grp <- grp.def.nc(nc, "oldgroup")
## Rename the group (operation not support by early versions of the netcdf4 library)
try(grp.rename.nc(grp, "newgroup"))
close.nc(nc)
unlink(file1)
# }
Run the code above in your browser using DataLab