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
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
Hi
notEmpty <- subset(tt, tt$ID !="")
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 != "", ]
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
What have you tried? This is a quite basic R question on slicing/subsetting a dataframe.
Basic R questions are more relevant to StackOverflow: