[R] how to extract strings in any column and in any row that start with

Ana Marija @okov|c@@n@m@r|j@ @end|ng |rom gm@||@com
Fri May 15 19:00:04 CEST 2020


Hello,

I have a data frame:

> dim(tot)
[1] 502536   1093

How would I extract from it all strings that start with E10?

I know how to extract all rows that contain with E10
df0<-tot %>% filter_all(any_vars(. %in% c('E10')))
> dim(df0)
[1] 5105 1093

but I just need a vector of strings that start with E10...
it would look something like this:

[1] "E102" "E109" "E108" "E103" "E104" "E105" "E101" "E106" "E107"

Thanks
Ana



More information about the R-help mailing list