Learn R Programming

ncdfCF (version 0.1.1)

attribute,ncdfObject-method: 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 ncdfObject
attribute(object, att)

Value

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

Arguments

object

A ncdfObject instance.

att

Attribute to find in $name column.

Examples

Run this code
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")

Run the code above in your browser using DataLab