attribute,ncdfObject-method {ncdfCF}R Documentation

Get an attribute value

Description

Extract the value of a named attribute of the ncdfCF object. When found, the value will have the type of the attribute and it may be of type list if the attribute has multiple values.

Usage

## S4 method for signature 'ncdfObject'
attribute(object, att)

Arguments

object

A ncdfObject instance.

att

Attribute to find in $name column.

Value

Value of the $value column or character(0) when not found.

Examples

fn <- system.file("extdata",
                  "pr_day_EC-Earth3-CC_ssp245_r1i1p1f1_gr_20240101-20241231_vncdfCF.nc",
                  package = "ncdfCF")
ds <- open_ncdf(fn)
lon <- ds[["lon"]]
attribute(lon, "standard_name")

[Package ncdfCF version 0.1.1 Index]