Entering edit mode
7.9 years ago
mzezza
▴
10
Hi,
I have a dataframe with n columns and n rows. I need to search all cells (type string) that starts with "chr......" and I need to delete the corresponding row.
Did you help me ?
Thanks.
Maybe, this could help you
Delete rows containing specific strings in R
remove rows containing certain data
This is more a programming question than bioinformatics...
So if a row contains one element which starts with "chr" the entire row has to be deleted?
I highly recommend the dplyr package by Hadley Wickham: https://cran.rstudio.com/web/packages/dplyr/vignettes/introduction.html.
So do I - but it is not especially relevant to this problem.
Fair enough. I thought filter() would easily address the problem but there's no straightforward way of filtering on all columns.
Thanks you all, your advice has been useful. I solved with grepl function.
Now, another question: I need to delete from a dataframe rows of another dataframe (with the same structure) using, maybe, a common cell.
Thanks for your help.
Thanks you all, your advice has been useful. I solved with grepl function.
Now, another question: I need to delete from a dataframe rows of another dataframe (with the same structure) using, maybe, a common cell.
Thanks for your help.
It's advisable to create new threads for new questions. In addition, this is again not a bioinformatics question.