getnames: Get names by string matching or class

View source: R/utils_df.R

getnamesR Documentation

Get names by string matching or class

Description

Get names by string matching or class

Usage

getnames(
  x,
  pattern = NULL,
  starts_with = NULL,
  ends_with = NULL,
  ignore_case = TRUE
)

getfactornames(x)

getnumericnames(x)

getlogicalnames(x)

getcharacternames(x)

getdatenames(x)

Arguments

x

object with names() method.

pattern

Character: pattern to match anywhere in names of x.

starts_with

Character: pattern to match in the beginning of names of x.

ends_with

Character: pattern to match at the end of names of x.

ignore_case

Logical: If TRUE, well, ignore case.

Details

For getnames() only: pattern, starts_with, and ends_with are applied sequentially. If more than one is provided, the result will be the intersection of all matches.

Value

Character vector of matched names.

Author(s)

EDG

Examples

getnames(iris, starts_with = "Sepal")
getnames(iris, ends_with = "Width")
getfactornames(iris)
getnumericnames(iris)

rtemis documentation built on Oct. 20, 2026, 1:06 a.m.