Returns attributes from a netCDF files

getAttributes(nc, varid = 0, print = TRUE)

Arguments

nc

An object of class ncdf4 (as returned from nc_open), indicating what file to read from.

varid

The variable whose attribute is to be read. Can be a character string with the variable's name or an object of class ncvar4. As a special case, if varid == 0, then a global (file) attribute will be read rather than a particular variable's attribute.

print

Logical specifying whether human readable output should be printed to the console.

Value

A named list of netCDF attributes is returned invisibly.