extract_differences_between_characters: Identify shared leading or trailing character strings

View source: R/extract_differences_between_characters.R

extract_differences_between_charactersR Documentation

Identify shared leading or trailing character strings

Description

For a vector of character strings, identify elements between shared leading and/or trailing substrings, e.g. for a vector such as c("XXX01YYY",XXX02YYY") extract the numbers.

Usage

extract_differences_between_characters(strings)

Arguments

strings

vector of character strings for elements to be extracted from.

Value

vector of strings similar to the input vector but without shared leading and trailing characters.

Author(s)

Eike Luedeling

Examples


  extract_differences_between_characters(c("Temp_01","Temp_02","Temp_03"))
  extract_differences_between_characters(c("Temp_01_Tmin","Temp_02_Tmin","Temp_03_Tmin"))
  extract_differences_between_characters(c("a","b"))                                           
 

chillR documentation built on Nov. 28, 2023, 1:09 a.m.