I have a list of character strings:
> head(g_patterns_clean_strings)
[[1]]
[1] "1FAFA"
[[2]]
[1] "FA,TRFA"
[[3]]
[1] "FAEX"
I am trying to identify specific patterns in these character strings, as such:
library(devtools)
g_patterns_clean <- source_gist("164f798524fd6904236a")[[1]]
g_patterns_clean_strings <- source_gist("af70a76691aacf05c1bb")[[1]]
FA_logic_vector <- grepl(g_patterns_clean_strings, pattern = "(FA)+")
FA_cluster <- subset(g_patterns_clean, FA_logic_vector)
Let's now say that I want to check for strings where "FA"
accounts for X% of the total strings length (e.g. "FA"
accounts for 25% of the characters in each string that is going to be matched). How can I accomplish this?