I've got a dataframe with a column containing peptide sequences and I want to keep only rows that have no internal "R" or "K" in their string.
df1 <- data.frame(
Peptide = c("ABCOIIJUHFSAUJHR", "AOFIAUKOAISDFUK", 'ASOIRDFHAOHFKK'))
df1 #check output
As output I would like to keep only the first row (i.e. "ABCOIIJUHFSAUJHR").
I have tried using filter (dplyr) and str_locate_all from the stringr package and length but couldn't figure it out.
Any help would be much appreciated.
Thanks Moe