View source: R/identify_common_string.R
identify_common_string | R Documentation |
Compares all elements of a vector of numbers or character strings and returns TRUE if they are all the same, FALSE otherwise.
identify_common_string(strings, leading = TRUE)
strings |
vector of strings to be evaluated. |
leading |
boolean variable indicating whether the function should look for common strings at the beginning (leading==TRUE) or end (leading==FALSE) of the strings. Default is TRUE. |
if there is a leading (if leading==TRUE) or trailing (if leading==FALSE) string that all elements of strings have in common, this string is returned; NA otherwise.
Eike Luedeling
identify_common_string(c("Temp_01","Temp_02","Temp_03"))
identify_common_string(c("Temp_01","Temp_02","Temp_03"),leading=FALSE)
identify_common_string(c("file1.csv","file2.csv","file3.csv"),leading=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.