RAnEn::writeNcVar can write a variable to a new NetCDF file if the file does not exist. If the fist exists, RAnEn::writeNcVar tries to append the variable to the existing file.
writeNcVar(variable_name, variable_data, dim_names, nc_file, verbose = F)
The name of the variable
The data for the variable. It can be a vector, a matrix, or an array.
The dimension names associated with the variable.
The complete NetCDF file path
Whether to be verbose
This is a more general function than RAnEn::writeNetCDF
because RAnEn::writeNetCDF
only takes a Forecasts
or an Observations
. But RAnEn::writeNcVar
takes any numeric
arrays (including vectors, matrices, and arrays) and write them to an NetCDF file. This
can be helpful when you are saving AnEn
results from RAnEn::generateAnalogs
.