thank you ahmad mousavi
Remove lines from a toptable that have an empty ID (symbol)
Hi,
How to remove lines (genes) from a toptable tt that have an empty ID (symbol)? These genes are not annotated and
I would like to remove them from the toptable.
the columns are:
row.names, ID, logFC, AverExpr, …
Thanks
• 2,201 views
•
link
1 answer
Hi
notEmpty <- subset(tt, tt$ID !="")
• 0 views
•
link
• 0 views
•
link
If an answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted.

• 0 views
•
link
No need to call tt in subset again, try:
notEmpty <- subset(tt, ID != "")
Also note, from ?subset manual:
This is a convenience function intended for use interactively. For programming it is better to use the standard subsetting functions like [, and in particular the non-standard evaluation of argument subset can have unanticipated consequences.
So the preferred way would be:
notEmpty <- tt[ tt$ID != "", ]
• 0 views
•
link
yeah that's work too, nice code !!
• 0 views
•
link
Log in to answer this question.
What have you tried? This is a quite basic R question on slicing/subsetting a dataframe.
Basic R questions are more relevant to StackOverflow: