extract_insensitive: Detect and extract matching strings - ignoring case.

View source: R/rename_matches.R

extract_insensitiveR Documentation

Detect and extract matching strings – ignoring case.

Description

Detect and extract matching strings – ignoring case.

Return TRUE in position where name of x is in y; FALSE otherwise.

Usage

extract_insensitive(x, y)

detect_insensitive(x, y)

Arguments

x

A string to be muted as in y, it a case insensitive match is found.

y

A string to use as a reference to match x.

Value

detect_* and extract_* return a logical vector and a string.

See Also

Other functions for developers: check_crucial_names(), flag_if_group(), is_multiple(), nms_try_rename(), rename_matches(), type_ensure()

Other general functions to deal with names: rename_matches()

Examples

x <- c("stemid", "n")
y <- c("StemID", "treeID")
detect_insensitive(x, y)
extract_insensitive(x, y)

vft <- data.frame(TreeID = 1, Status = 1)
extract_insensitive(tolower(names(vft)), names(vft))
extract_insensitive(names(vft), tolower(names(vft)))

fgeo.tool documentation built on Sept. 3, 2022, 5:05 p.m.