try_att: TryCatch around RNetCDF::att.get.nc()

View source: R/utils.R

try_attR Documentation

TryCatch around RNetCDF::att.get.nc()

Description

TryCatch around RNetCDF::att.get.nc()

Usage

try_att(nc, variable, attribute)

Arguments

nc

"NetCDF" object which points to the NetCDF dataset. Found with RNetCDF::open.nc.

variable

ID or name of the variable from which the attribute will be read, or "NC_GLOBAL" for a global attribute.

attribute

Attribute name or ID.

Value

Vector with a data type that depends on the NetCDF variable. For NetCDF variables of type NC_CHAR, the R type is either character or raw, as specified by argument rawchar. For NC_STRING, the R type is character. Numeric variables are read as double precision by default, but the smallest R type that exactly represents each external type is used if fitnum is TRUE.


mikejohnson51/opendap.catalog documentation built on Jan. 27, 2023, 1:25 a.m.