[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


Hello,

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:
s=select(tot,starts_with("E94"))

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

Thanks
Ana



More information about the R-help mailing list