Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dfSubset <- df[apply(df, 1, function(i) any(grepl(paste(my.list, collapse="|"), i))),]
- write_tsv(dfSubset, "dfSubset.txt", col_names=TRUE)
- my.list <- c("035", "566", "60883", "6110", "6752", "6751", "680","681","682","683","684","684",
- "685","686", "7048", "70583","7070", "7078", "7079", "7071", "7280", "72886",
- "7714", "7715", "7854", "9583", "99662", "99762", "9985")
- # Fake data
- set.seed(10)
- df = as.data.frame(replicate(5, sample(c(SSTI.list, 1e5:(1e5+1000)),10)), stringsAsFactors=FALSE)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement