Skip to contents

get_prefix returns the longest common prefix of the supplied words.

Usage

get_prefix(words)

Arguments

words

Character vector, A list of words.

Value

A character vector containing the prefix.

Examples

# Load example
data(Silicosis_pg)
data <- Silicosis_pg
names <- grep("LFQ.", colnames(data), value = TRUE)

# Get prefix
get_prefix(names)
#> [1] "LFQ.intensity."