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.
如果我有一个数组定义为:
Q <- array(runif(48), c(4,4,3), dimnames=list( c("P","PO","C","T"), c("LL","RR","R","Y"), c("Jerry1", "Jerry2", "Jerry3")))
我想做的是检查数组 Q 中地址 Q[1, 4,] 的每个“Jerry_n”矩阵,如果 Q[1, 4] 小于 Q[1, 1, ],那么我会喜欢删除那个杰里矩阵。
非常感谢您提供的任何帮助。
我认为
dropmat <- Q[1,4,] < Q[1,1,] Q <- Q[,,!dropmat]
应该这样做...
编辑:将结果分配给原始。
Q[,,Q[1,1,]<=Q[1,4,]]
那是你要的吗?
编辑:更新了不等式。