50% off: Unlimited data and AI learning.
State of Data and AI Literacy Report 2025

lintr (version 3.0.2)

expect_named_linter: Require usage of expect_named(x, n) over expect_equal(names(x), n)

Description

testthat::expect_named() exists specifically for testing the names() of an object. testthat::expect_equal() can also be used for such tests, but it is better to use the tailored function instead.

Usage

expect_named_linter()

Arguments

Tags

best_practices, package_development, readability

See Also

linters for a complete list of linters available in lintr.