如何找到包含大于或等于给定数字的值的R矩阵的列数?
我有一个带有52列的矩阵和5,000行。 想找到包含一个小于或等于值的值的列数(例如,52个中的多少列包含小于或等于10的数字)
我 做这项工作的方法。
谢谢!
I have a matrix with 52 columns, and 5,000 rows. I want to find the number of columns that contain a value less than or equal to a value (for example, how many columns out of 52 contain a number less than or equal to 10)
I was trying rowSum but I cannot remember / find a way to make this work.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
一个可能的解决方案:
A possible solution:
写自己的功能怎么样?
这是代码。
How about writing your own function?
Here's the code.
说尺寸5000x52的矩阵
mat
,然后我们可以找到52列中有多少列包含一个小于或等于10的数字
Say the matrix
mat
of dimensions 5000x52then we can find how many columns out of 52 contains a number less than or equal to 10 using