Displaying 1 result from an estimated 1 matches for "5.719641".
2011 Dec 08
2
Behavior of apply()
Suppose I have the following matrix
> class(cov_50)
[1] "matrix"
> cov_50
[,1] [,2]
[1,] 0.3201992 2.308084
[2,] 6.7312928 5.719641
I then use the following function via apply and get the desired output, a list
signif <- function(x) which(abs(x) > 1.96)
apply(cov_50, 1, signif)
> apply(cov_50, 1, signif)
[[1]]
[1] 2
[[2]]
[1] 1 2
However, I can't