I am using dplyr
and I would like to filter my dataframe (biotypes) according to sample IDs which are the first column of the data frame, e.g. they look like this:
ID
chrX.tRNA494-SerAGA
chrX.tRNA636-AlaCGC
mmu_piR_000007
...
I want to filter IDs starting with "chr" from IDs starting with "mmu":
biotype<- biotype %>%
filter( str_detect (biotype, "^chr") ==TRUE )
biotype
Can anyone help please? I am just looking for something like *
that allows me to filter all rows that have a string starting with these particular characters ...