Learn R Programming

chillR (version 0.75)

extract_differences_between_characters: 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)

Value

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

Arguments

strings

vector of character strings for elements to be extracted from.

Author

Eike Luedeling

Examples

Run this code

  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"))                                           
 

Run the code above in your browser using DataLab