Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 R 的列中找到以特定值结尾的列的长度?
我已经坚持了几个小时,请帮忙!
您的问题不完整:例如,您是否想要特定值的第一个实例?如果是这样,那么
which( my_matrix[,my_column_number] == my_value) 将返回匹配的索引,它恰好是列中该点的长度。==(适用于使用浮点数据的常见警告)。
which( my_matrix[,my_column_number] == my_value)
==