extract_prefix: Extract prefix from names

View source: R/extract_prefix.R

extract_prefixR Documentation

Extract prefix from names

Description

Extract prefixes from names, presumably colnames. For example, the prefix of "x.p" would be "x".

Usage

extract_prefix(nm, suffix = "p", sep = ".")

Arguments

nm

Character vector of names to search.

suffix

Character string to search for at end of nm.

sep

Separator in nm preceeding suffix. One of ".", "_", NA, If NA, elements of nm must match suffix exactly.

Value

A character vector of prefixes. If there is no prefix and no sep, NA is returned.


jdreyf/ezlimmaplot documentation built on Feb. 8, 2025, 2:25 a.m.