RAnEn::readNc reads an NetCDF file as a list with ncdf4 interface.

readNc(
  file,
  root_group_only = T,
  var_names = NULL,
  include_root_attrs = F,
  return_class = NULL
)

Arguments

file

The file to read

root_group_only

Whether to read only root group variables

var_names

By default, var_names are set to NULL and this function reads all variables from the file. Set this argument if you only want to read a subset of variables from the NetCDF file. If this argument is set, root_group_only will be ignored. To read variables from a sub group, you need to also include the group name as if it was a folder, for exmple, group_name/variable_name. If var_names is a named vector, the names will be used in the list.

include_root_attrs

Whether to read the root group attributes.

return_class

Setting this argument to simply change the class of the returned list to support formatted output, e.g. AnEn.

Author

Weiming Hu weiming@psu.edu