r - Selecting rows in the table by specific mark -


i have huge data file. in 1 column have specific sequences of big letters, looks "fapygtitsakvmrte". there 1000 rows of such sequences. important me select sequences has atleast 1 "k" in sequence. rest of them can ignore. how pick sequences whole data set ? if it's needed can upload data file somewhere.

try using grepl

> set.seed(2) > df <- data.frame(sequences=replicate(10, paste0(sample(letters[7:12], 5, true), collapse=""))) # example  >df[grepl("k", df$sequence), , drop = false] # henrik's comment    sequences 1      hkjhl 3      jhkhi 7      ggklj 8      jlhkg 10     klijk 

Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -