get_prefix: Obtain the longest common prefix

Description Usage Arguments Value Examples

View source: R/functions.R

Description

get_prefix returns the longest common prefix of the supplied words.

Usage

1
get_prefix(words)

Arguments

words

Character vector, A list of words.

Value

A character vector containing the prefix.

Examples

1
2
3
4
5
6
7
# Load example
data <- UbiLength
columns <- grep("LFQ.", colnames(data))

# Get prefix
names <- colnames(data[, columns])
get_prefix(names)

DEP documentation built on Nov. 8, 2020, 7:49 p.m.