ESet 的子集 /除以 ESet
是否可以像这样对 ExpressionSet 进行子集化:
SUB=ESet[,ESet@phenoData@data$x==c(0,1)]
是 0-9 的值,我只想要 x=0 或 x=1 时的条目。
Is it possible to subset a ExpressionSet like this:
SUB=ESet[,ESet@phenoData@data$x==c(0,1)]
in X are values from 0-9, and I just want the entries when x=0 or x=1.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请尝试以下操作:
乍一看,
==
和%in%
之间的区别似乎很细微。但是
%in%
永远不会返回NA
,这可能很有用,甚至是必需的,具体取决于您想要做什么。在下面构造的示例中,==
返回NA
,而%in%
返回预期结果:但差异远不止于此。从 ?
==
的帮助文件中可以明显看出,在不等长度的向量之间进行二进制比较时,较短向量的元素会根据需要进行回收。尝试以下示例:
这会产生一个空向量。如果您回收向量 c(1, 2),很快就会明白原因:
Try the following:
At first glance, the difference between
==
and%in%
seems only subtle.But
%in%
will never returnNA
, and this could be useful, or even essential, depending on what you want to do. In the following constructed example,==
returnsNA
, whilst%in%
returns the expected result:But the difference is much deeper than this. From the help files for ?
==
it is apparent that when making binary comparisons between vectors of unequal length, the elements of shorter vectors are recycled as necessary.Try for example the following:
This results in an empty vector. If you recycle the vector c(1, 2), it quickly becomes apparent why: