[R] how to get all strings in a data frame that start with a particular string

Ana Marija @okov|c@@n@m@r|j@ @end|ng |rom gm@||@com
Fri Apr 10 18:15:45 CEST 2020



I have a data frame (tot) with about 2000 columns. How can I extract
from it all strings that start with E14?

I tried this:
e14 <- sapply(tot, function(x) grepl("^E14", x))

but this returns me just TRUE and FALSE vector, how do I get actual
strings that start with E14?


More information about the R-help mailing list