Concatenates the records of the same variable from multiple netCDF files along the unlimited dimension and writes the result to a new file.
Details
All files must contain the selected variable and must be compatible in all
non-unlimited dimensions. The unlimited dimension is appended in the order
given by filenames.
Examples
local({
input = system.file("extdata",
"temperature_2001_01.nc",
package = "nctools",
mustWork = TRUE)
output = tempfile(fileext = ".nc")
on.exit(unlink(output))
files = system.file("extdata",
sprintf("temperature_2001_%02d.nc",
1:3),
package = "nctools",
mustWork = TRUE)
first = tempfile(fileext = ".nc")
on.exit(unlink(first), add = TRUE)
nc_rcat(files[1:2], "temperature", first)
nc_rcat(c(first, files[3]), "temperature", output)
})