[R] how to select all columns that contain in any of their rows a partial match for a string?

Ana Marija @okov|c@@n@m@r|j@ @end|ng |rom gm@||@com
Sat Oct 5 20:50:59 CEST 2019


I have a data frame tot which has many columns and many rows.

I am trying to find all columns that have say a value in any of their
rows that STARTS WITH: "E94"

for example there are columns like this:

> unique(tot$diagnoses_icd9_f41271_0_44)
[1] NA      "E9420"

I tried:

but this didn't return me anything. Data type in those columns is character.


More information about the R-help mailing list