attr2: Obtain an attribute of an object without partial matching

View source: R/utils.R

attr2R Documentation

Obtain an attribute of an object without partial matching

Description

An abbreviation of base::attr(exact = TRUE).

Usage

attr2(...)

attr(...)

Arguments

...

Passed to base::attr() (without the exact argument).

Note

xfun::attr() is deprecated. Please use xfun::attr2() instead.

Examples

z = structure(list(a = 1), foo = 2)
base::attr(z, "f")  # 2
xfun::attr2(z, "f")  # NULL
xfun::attr2(z, "foo")  # 2

xfun documentation built on April 3, 2025, 7:04 p.m.